summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/udevadm-lock.c')
-rw-r--r--src/udev/udevadm-lock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/udev/udevadm-lock.c b/src/udev/udevadm-lock.c
index d19e7561f8..6d8a5c336f 100644
--- a/src/udev/udevadm-lock.c
+++ b/src/udev/udevadm-lock.c
@@ -75,6 +75,9 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
+ /* Resetting to 0 forces the invocation of an internal initialization routine of getopt_long()
+ * that checks for GNU extensions in optstring ('-' or '+' at the beginning). */
+ optind = 0;
while ((c = getopt_long(argc, argv, arg_print ? "hVd:b:t:p" : "+hVd:b:t:p", options, NULL)) >= 0)
switch (c) {