diff options
author | Jiri Popelka <jpopelka@redhat.com> | 2012-06-21 11:30:22 +0200 |
---|---|---|
committer | Jiri Popelka <jpopelka@redhat.com> | 2012-06-26 12:05:28 +0200 |
commit | 699e5db88236deff1ff4cc657a8d978c25790587 (patch) | |
tree | 19854119440fe0f049abc7f51c96e7668313d449 /nameif.c | |
parent | 6d09cad3b7fdd9d22648cd3ee64ce6bc8e2faab0 (diff) | |
download | net-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |