Skip to contentSkip to conversation

nanddump: Pass Real Names as Arguments to perror

PATCH In review Grant Erickson 1 participant 1 message Sep 8, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 nanddump: Pass Real Names as Arguments to perror

Pass the MTD device node and dump file name as arguments to perror rather than more ambigous, static messages on open failures.

---
 nanddump.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
nanddump.c +2 -2
index 8c7175c..168fbbb 100644
@@ -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);
 	}
Signature · 1 line
1.6.0.1