]> www.infradead.org Git - mtd-utils.git/commitdiff
nanddump: Pass Real Names as Arguments to perror
authorGrant Erickson <gerickson@nuovations.com>
Sun, 7 Sep 2008 20:45:36 +0000 (20:45 +0000)
committerJosh Boyer <jwboyer@gmail.com>
Mon, 8 Sep 2008 14:28:27 +0000 (10:28 -0400)
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>
nanddump.c

index 8c7175c0757eb0aa3043bfc254ab3b9d019ec12e..168fbbb14fc0e6669ab4076f826457f2f6194b7d 100644 (file)
@@ -182,7 +182,7 @@ int main(int argc, char * const argv[])
 
        /* Open MTD device */
        if ((fd = open(mtddev, O_RDONLY)) == -1) {
-               perror("open flash");
+               perror(mtddev);
                exit (EXIT_FAILURE);
        }
 
@@ -249,7 +249,7 @@ int main(int argc, char * const argv[])
        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);
        }