summaryrefslogtreecommitdiffstats
path: root/sys-utils/switch_root.c
diff options
context:
space:
mode:
authorPaul Asmuth2018-11-09 17:02:11 +0100
committerPaul Asmuth2018-11-12 14:20:45 +0100
commit9737a1671117e2d8ade95cd46df2c0787d9266cd (patch)
tree8c3a0654a74ab64a0a0696ece4d6ba26c81355d2 /sys-utils/switch_root.c
parentrtcwake: use poweroff if shutdown is not found (diff)
downloadkernel-qcow2-util-linux-9737a1671117e2d8ade95cd46df2c0787d9266cd.tar.gz
kernel-qcow2-util-linux-9737a1671117e2d8ade95cd46df2c0787d9266cd.tar.xz
kernel-qcow2-util-linux-9737a1671117e2d8ade95cd46df2c0787d9266cd.zip
fix a bug where switch_root would erroneously try to parse initargs
before this change, switch_root would try to parse all arguments, including 'initargs', using getopt, which would lead to an 'unrecognized option' error when trying to pass a flag to the init program
Diffstat (limited to 'sys-utils/switch_root.c')
-rw-r--r--sys-utils/switch_root.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c
index 3c66d0186..a85ce24b9 100644
--- a/sys-utils/switch_root.c
+++ b/sys-utils/switch_root.c
@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
atexit(close_stdout);
- while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
+ while ((c = getopt_long(argc, argv, "+Vh", longopts, NULL)) != -1)
switch (c) {
case 'V':
printf(UTIL_LINUX_VERSION);