summaryrefslogtreecommitdiffstats
path: root/src/udev/udevadm.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-10-25 21:31:38 +0200
committerKay Sievers <kay@vrfy.org>2012-10-25 21:31:38 +0200
commite5f2783e73a98cfb067f10eeed2289b454c9e672 (patch)
tree609fd295cb11df0440aa0055f2637c212f859cf6 /src/udev/udevadm.c
parentjob: avoid recursion into transaction code from job cancelation (diff)
downloadsystemd-e5f2783e73a98cfb067f10eeed2289b454c9e672.tar.xz
systemd-e5f2783e73a98cfb067f10eeed2289b454c9e672.zip
udev: set optind = 0, not the usual 1, to reset getopt_long()s internal state
Diffstat (limited to 'src/udev/udevadm.c')
-rw-r--r--src/udev/udevadm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c
index d1e9756b2e..5e69e192c0 100644
--- a/src/udev/udevadm.c
+++ b/src/udev/udevadm.c
@@ -134,7 +134,8 @@ int main(int argc, char *argv[])
if (strcmp(udevadm_cmds[i]->name, command) == 0) {
argc -= optind;
argv += optind;
- optind = 1;
+ /* we need '0' here to reset the internal state */
+ optind = 0;
rc = run_command(udev, udevadm_cmds[i], argc, argv);
goto out;
}