[PATCH v0 02/20] jffs2dump: Use defines for exit code values

Daniel Wagner daniel.wagner at siemens.com
Mon Jun 12 03:50:43 PDT 2017


Make the usage of exit consist. That is use the pre defined exit
values.

Signed-off-by: Daniel Wagner <daniel.wagner at siemens.com>
---
 jffsX-utils/jffs2dump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/jffsX-utils/jffs2dump.c b/jffsX-utils/jffs2dump.c
index df5b1e120b69..2200f06919a5 100644
--- a/jffsX-utils/jffs2dump.c
+++ b/jffsX-utils/jffs2dump.c
@@ -751,7 +751,7 @@ int main(int argc, char **argv)
 	/* Open the input file */
 	if ((fd = open(img, O_RDONLY)) == -1) {
 		perror("open input file");
-		exit(1);
+		exit(EXIT_FAILURE);
 	}
 
 	// get image length
@@ -762,7 +762,7 @@ int main(int argc, char **argv)
 	if (!data) {
 		perror("out of memory");
 		close (fd);
-		exit(1);
+		exit(EXIT_FAILURE);
 	}
 
 	if (datsize && oobsize) {
@@ -796,5 +796,5 @@ int main(int argc, char **argv)
 	free (data);
 
 	// Return happy
-	exit (0);
+	exit (EXIT_SUCCESS);
 }
-- 
2.9.4




More information about the linux-mtd mailing list