diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-04-07 10:55:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-07 10:55:30 +0200 |
commit | ddd43f31e3be45a276ec4191eace333f844b98b8 (patch) | |
tree | b92573d9b4beb6a6e3f049993f27349273110e40 /src/udev | |
parent | 9c1d3d6fa7f00673c0f650139cf5e9a3d4f37827 (diff) | |
parent | 6339d3e6021f31a8a8907c2613f1aaac279fe745 (diff) | |
download | systemd-ddd43f31e3be45a276ec4191eace333f844b98b8.tar.gz |
Merge pull request #26887 from yuwata/proc-cmdline-filter-arguments
proc-cmdline: filter PID1 arguments on container
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udevadm-lock.c | 3 | ||||
-rw-r--r-- | src/udev/udevadm.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/udev/udevadm-lock.c b/src/udev/udevadm-lock.c index 9a4a8adbc3..b9f18d1552 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) { diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c index 30a72f2a42..b803f7bb0f 100644 --- a/src/udev/udevadm.c +++ b/src/udev/udevadm.c @@ -62,6 +62,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, "+dhV", options, NULL)) >= 0) switch (c) { |