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>
/* Open the input file */
if ((fd = open(img, O_RDONLY)) == -1) {
perror("open input file");
- exit(1);
+ exit(EXIT_FAILURE);
}
// get image length
if (!data) {
perror("out of memory");
close (fd);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (datsize && oobsize) {
free (data);
// Return happy
- exit (0);
+ exit (EXIT_SUCCESS);
}
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;
switch (c) {
case 'h':
- usage(0);
+ usage(EXIT_SUCCESS);
break;
case 'i':
req = REQUEST_ISLOCKED;
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;
/* 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 */
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':
}
}
if (argc - optind != 1)
- usage(1);
+ usage(EXIT_FAILURE);
if (error)
errmsg_die("Try --help for more information");
int idx = 0;
if (argc < 2)
- usage(1);
+ usage(EXIT_FAILURE);
nftl = "NFTL";
break;
case 'h':
case '?':
- usage(0);
+ usage(EXIT_SUCCESS);
break;
case 'V':
display_version();
break;
default:
- usage(1);
+ usage(EXIT_FAILURE);
break;
}
}