summaryrefslogtreecommitdiff
path: root/nameif.c
diff options
context:
space:
mode:
authorJiri Popelka <jpopelka@redhat.com>2012-06-21 11:30:22 +0200
committerJiri Popelka <jpopelka@redhat.com>2012-06-26 12:05:28 +0200
commit699e5db88236deff1ff4cc657a8d978c25790587 (patch)
tree19854119440fe0f049abc7f51c96e7668313d449 /nameif.c
parent6d09cad3b7fdd9d22648cd3ee64ce6bc8e2faab0 (diff)
downloadnet-tools-699e5db88236deff1ff4cc657a8d978c25790587.tar.gz
net-tools-699e5db88236deff1ff4cc657a8d978c25790587.tar.bz2
net-tools-699e5db88236deff1ff4cc657a8d978c25790587.zip
Consistently use defined exit codes.
Tools have been inconsistently using exit codes when started with --help/--version. With this patch all tools use exit codes E_USAGE/E_VERSION defined in net-support.h. There's probably no rule what exit codes should programs use when started with --help/--version, but when I'm checking programs on my system most of them use 0 (SUCCESS) exit code. Therefore I redefined E_USAGE/E_VERSION to EXIT_SUCCESS (0).
Diffstat (limited to 'nameif.c')
-rw-r--r--nameif.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nameif.c b/nameif.c
index c77c4fe..61bf85f 100644
--- a/nameif.c
+++ b/nameif.c
@@ -22,6 +22,7 @@
#include <linux/sockios.h>
#include <errno.h>
#include "intl.h"
+#include "net-support.h"
const char default_conf[] = "/etc/mactab";
const char *fname = default_conf;
@@ -200,7 +201,7 @@ struct option lopt[] = {
void usage(void)
{
fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n"));
- exit(1);
+ exit(E_USAGE);
}
int main(int ac, char **av)