Pass the MTD device node and dump file name as arguments to perror
rather than more ambigous, static messages on open failures.
Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
/* Open MTD device */
if ((fd = open(mtddev, O_RDONLY)) == -1) {
- perror("open flash");
+ perror(mtddev);
exit (EXIT_FAILURE);
}
if (!dumpfile) {
ofd = STDOUT_FILENO;
} else if ((ofd = open(dumpfile, O_WRONLY | O_TRUNC | O_CREAT, 0644))== -1) {
- perror ("open outfile");
+ perror (dumpfile);
close(fd);
exit(EXIT_FAILURE);
}