From: Sami Kerola Date: Sun, 30 Oct 2011 14:08:18 +0000 (+0100) Subject: tunelp: use symbolic exit values X-Git-Tag: v2.21-rc1~194^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=130314aa70616237082a6b68ffac8faae438cb6f;p=thirdparty%2Futil-linux.git tunelp: use symbolic exit values Signed-off-by: Sami Kerola --- diff --git a/sys-utils/tunelp.c b/sys-utils/tunelp.c index 53693ecdf1..be4a6f6834 100644 --- a/sys-utils/tunelp.c +++ b/sys-utils/tunelp.c @@ -64,6 +64,9 @@ #include "nls.h" #include "xalloc.h" +#define EXIT_BAD_VALUE 3 +#define EXIT_LP_IO_ERR 4 + struct command { long op; long val; @@ -91,7 +94,7 @@ static long get_val(char *val) long ret; if (!(sscanf(val, "%ld", &ret) == 1)) { fprintf(stderr, _("%s: bad value\n"), progname); - exit(3); + exit(EXIT_BAD_VALUE); } return ret; } @@ -219,7 +222,7 @@ int main(int argc, char **argv) case 'v': case 'V': print_version(progname); - exit(0); + return EXIT_SUCCESS; default: print_usage(progname); } @@ -295,7 +298,7 @@ int main(int argc, char **argv) retval = ioctl(fd, LPGETIRQ - offset, &irq); if (retval == -1) { perror(_("LPGETIRQ error")); - exit(4); + return EXIT_LP_IO_ERR; } if (irq == (int)0xdeadbeef) /* up to 1.1.77 will do this */ @@ -308,5 +311,5 @@ int main(int argc, char **argv) close(fd); - return 0; + return EXIT_SUCCESS; }