diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-08 01:59:58 +0100 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-01-17 08:58:29 -0500 |
commit | 79332668e3d8eff6de9e916dd3f26944d35ecb82 (patch) | |
tree | e1e246c0ef8231a80fbb217e9b8a21e6682cd7d9 /src | |
parent | 1b0002257baee46cadd23e936b3f7407c68f0bba (diff) |
udevadm: don't hit an assert when obsolete parameters are passed
https://bugzilla.redhat.com/show_bug.cgi?id=1178051
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/udev/udevadm-settle.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index 21750aaa18..fff5de7a8b 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -48,12 +48,12 @@ static void help(void) { static int adm_settle(struct udev *udev, int argc, char *argv[]) { static const struct option options[] = { - { "seq-start", required_argument, NULL, '\0' }, /* removed */ - { "seq-end", required_argument, NULL, '\0' }, /* removed */ { "timeout", required_argument, NULL, 't' }, { "exit-if-exists", required_argument, NULL, 'E' }, - { "quiet", no_argument, NULL, 'q' }, /* removed */ { "help", no_argument, NULL, 'h' }, + { "seq-start", required_argument, NULL, 's' }, /* removed */ + { "seq-end", required_argument, NULL, 'e' }, /* removed */ + { "quiet", no_argument, NULL, 'q' }, /* removed */ {} }; const char *exists = NULL; @@ -63,8 +63,9 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { struct udev_queue *queue; int rc = EXIT_FAILURE; - while ((c = getopt_long(argc, argv, "s:e:t:E:qh", options, NULL)) >= 0) { + while ((c = getopt_long(argc, argv, "t:E:hs:e:q", options, NULL)) >= 0) { switch (c) { + case 't': { int r; @@ -76,14 +77,24 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { }; break; } + case 'E': exists = optarg; break; + case 'h': help(); return EXIT_SUCCESS; + + case 's': + case 'e': + case 'q': + log_info("Option -%c no longer supported.", c); + return EXIT_FAILURE; + case '?': return EXIT_FAILURE; + default: assert_not_reached("Unknown argument"); } |