projects
/
liboping.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/oping.c: Exit successfully when using the -h option.
[liboping.git]
/
src
/
oping.c
diff --git
a/src/oping.c
b/src/oping.c
index
0ef6ec6
..
a1dbade
100644
(file)
--- a/
src/oping.c
+++ b/
src/oping.c
@@
-107,7
+107,7
@@
static void context_destroy (ping_context_t *context)
free (context);
}
free (context);
}
-static void usage_exit (const char *name)
+static void usage_exit (const char *name
, int status
)
{
int name_length;
{
int name_length;
@@
-128,7
+128,7
@@
static void usage_exit (const char *name)
"by Florian octo Forster <octo@verplant.org>\n"
"for contributions see `AUTHORS'\n",
name);
"by Florian octo Forster <octo@verplant.org>\n"
"for contributions see `AUTHORS'\n",
name);
- exit (
1
);
+ exit (
status
);
}
static int read_options (int argc, char **argv)
}
static int read_options (int argc, char **argv)
@@
-201,8
+201,10
@@
static int read_options (int argc, char **argv)
}
case 'h':
}
case 'h':
+ usage_exit (argv[0], 0);
+ break;
default:
default:
- usage_exit (argv[0]);
+ usage_exit (argv[0]
, 1
);
}
}
}
}
@@
-329,7
+331,7
@@
int main (int argc, char **argv)
optind = read_options (argc, argv);
if ((optind >= argc) && (opt_filename == NULL)) {
optind = read_options (argc, argv);
if ((optind >= argc) && (opt_filename == NULL)) {
- usage_exit (argv[0]);
+ usage_exit (argv[0]
, 1
);
}
if (geteuid () != 0)
}
if (geteuid () != 0)