halt/reboot/powerdown: accept and ignore -i

This commit is contained in:
Denis Vlasenko 2009-04-12 15:59:35 +00:00
parent 51056b382a
commit e12c90217b

View File

@ -63,9 +63,11 @@ int halt_main(int argc UNUSED_PARAM, char **argv)
/* Parse and handle arguments */ /* Parse and handle arguments */
opt_complementary = "d+"; /* -d N */ opt_complementary = "d+"; /* -d N */
/* We support -w even if !ENABLE_FEATURE_WTMP, in order /* We support -w even if !ENABLE_FEATURE_WTMP,
* to not break scripts */ * in order to not break scripts.
flags = getopt32(argv, "d:nfw", &delay); * -i (shut down network interfaces) is ignored.
*/
flags = getopt32(argv, "d:nfwi", &delay);
sleep(delay); sleep(delay);
@ -89,10 +91,12 @@ int halt_main(int argc UNUSED_PARAM, char **argv)
if (ENABLE_FEATURE_CLEAN_UP) if (ENABLE_FEATURE_CLEAN_UP)
free(pidlist); free(pidlist);
} }
if (rc) if (rc) {
rc = kill(1, signals[which]); rc = kill(1, signals[which]);
} else }
} else {
rc = reboot(magic[which]); rc = reboot(magic[which]);
}
if (rc) if (rc)
bb_perror_nomsg_and_die(); bb_perror_nomsg_and_die();