summaryrefslogtreecommitdiffstats
path: root/sys-utils/tunelp.c
diff options
context:
space:
mode:
authorSami Kerola2011-10-30 15:08:18 +0100
committerSami Kerola2011-11-01 21:42:20 +0100
commit130314aa70616237082a6b68ffac8faae438cb6f (patch)
treeb39b8e5c5e65de6f02cca42a3079dbf27913c110 /sys-utils/tunelp.c
parenttunelp: fix coding style (diff)
downloadkernel-qcow2-util-linux-130314aa70616237082a6b68ffac8faae438cb6f.tar.gz
kernel-qcow2-util-linux-130314aa70616237082a6b68ffac8faae438cb6f.tar.xz
kernel-qcow2-util-linux-130314aa70616237082a6b68ffac8faae438cb6f.zip
tunelp: use symbolic exit values
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/tunelp.c')
-rw-r--r--sys-utils/tunelp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys-utils/tunelp.c b/sys-utils/tunelp.c
index 53693ecdf..be4a6f683 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;
}