summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@siemens.com>2017-06-12 12:50:43 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-14 10:53:15 +0200
commitccffc105b0b361150666f97b59ac72cff8466e9b (patch)
tree4c4b7022317a42172a187fa681896c514b27255e
parent871c2f1e898fc692e2966092372ee9c4ce31bbc0 (diff)
Use defines for exit code values
Make the usage of exit consist. That is use the pre defined exit values. Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--jffsX-utils/jffs2dump.c6
-rw-r--r--jffsX-utils/mkfs.jffs2.c2
-rw-r--r--misc-utils/flash_unlock.c10
-rw-r--r--nand-utils/nandtest.c6
-rw-r--r--nand-utils/nftl_format.c6
5 files changed, 15 insertions, 15 deletions
diff --git a/jffsX-utils/jffs2dump.c b/jffsX-utils/jffs2dump.c
index a8d082b..82f3197 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);
}
diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c
index ca5e0d5..88e6cab 100644
--- a/jffsX-utils/mkfs.jffs2.c
+++ b/jffsX-utils/mkfs.jffs2.c
@@ -1052,7 +1052,7 @@ static void formalize_posix_acl(void *xvalue, int *value_len)
if (offset > *value_len) {
printf("Length of JFFS2 ACL expression(%u) is longer than general one(%u).\n",
offset, *value_len);
- exit(1);
+ exit(EXIT_FAILURE);
}
memcpy(xvalue, buffer, offset);
*value_len = offset;
diff --git a/misc-utils/flash_unlock.c b/misc-utils/flash_unlock.c
index 94f4761..5a3aac5 100644
--- a/misc-utils/flash_unlock.c
+++ b/misc-utils/flash_unlock.c
@@ -87,7 +87,7 @@ static void process_args(int argc, char *argv[])
switch (c) {
case 'h':
- usage(0);
+ usage(EXIT_SUCCESS);
break;
case 'i':
req = REQUEST_ISLOCKED;
@@ -105,14 +105,14 @@ static void process_args(int argc, char *argv[])
common_print_version();
exit(0);
default:
- usage(1);
+ usage(EXIT_FAILURE);
break;
}
}
if (req_set > 1) {
errmsg("cannot specify more than one lock/unlock/islocked option");
- usage(1);
+ usage(EXIT_FAILURE);
}
arg_idx = optind;
@@ -120,10 +120,10 @@ static void process_args(int argc, char *argv[])
/* Sanity checks */
if (argc - arg_idx < 1) {
errmsg("too few arguments");
- usage(1);
+ usage(EXIT_FAILURE);
} else if (argc - arg_idx > 3) {
errmsg("too many arguments");
- usage(1);
+ usage(EXIT_FAILURE);
}
/* First non-option argument */
diff --git a/nand-utils/nandtest.c b/nand-utils/nandtest.c
index 5676733..9e39446 100644
--- a/nand-utils/nandtest.c
+++ b/nand-utils/nandtest.c
@@ -181,14 +181,14 @@ int main(int argc, char **argv)
switch (c) {
case 'h':
- usage(0);
+ usage(EXIT_SUCCESS);
break;
case 'V':
common_print_version();
exit(EXIT_SUCCESS);
break;
case '?':
- usage(1);
+ usage(EXIT_FAILURE);
break;
case 'm':
@@ -222,7 +222,7 @@ int main(int argc, char **argv)
}
}
if (argc - optind != 1)
- usage(1);
+ usage(EXIT_FAILURE);
if (error)
errmsg_die("Try --help for more information");
diff --git a/nand-utils/nftl_format.c b/nand-utils/nftl_format.c
index a329c59..ea8199d 100644
--- a/nand-utils/nftl_format.c
+++ b/nand-utils/nftl_format.c
@@ -234,7 +234,7 @@ int main(int argc, char **argv)
int idx = 0;
if (argc < 2)
- usage(1);
+ usage(EXIT_FAILURE);
nftl = "NFTL";
@@ -249,13 +249,13 @@ int main(int argc, char **argv)
break;
case 'h':
case '?':
- usage(0);
+ usage(EXIT_SUCCESS);
break;
case 'V':
display_version();
break;
default:
- usage(1);
+ usage(EXIT_FAILURE);
break;
}
}