diff options
Diffstat (limited to 'loader2/loader.c')
-rw-r--r-- | loader2/loader.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/loader2/loader.c b/loader2/loader.c index a29fcf86b..33d1657ed 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -574,8 +574,6 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData, loaderData->wepkey = strdup(argv[i] + 7); else if (!strncasecmp(argv[i], "linksleep=", 10)) num_link_checks = atoi(argv[i] + 10); - else if (!strncasecmp(argv[i], "allowcddma", 10)) - flags |= LOADER_FLAGS_ENABLECDDMA; else if (!strncasecmp(argv[i], "selinux=0", 9)) flags &= ~LOADER_FLAGS_SELINUX; else if (!strncasecmp(argv[i], "selinux", 7)) @@ -1501,6 +1499,18 @@ int main(int argc, char ** argv) { else rc = 0; + if ((rc == 0) && (FL_POWEROFF(flags) || FL_HALT(flags))) { + if (!(pid = fork())) { + char * cmd = (FL_POWEROFF(flags) ? strdup("/sbin/poweroff") : + strdup("/sbin/halt")); + execl(cmd, cmd, NULL); + fprintf(stderr, "exec of poweroff failed: %s", + strerror(errno)); + exit(1); + } + waitpid(pid, &status, 0); + } + #if defined(__s390__) || defined(__s390x__) /* FIXME: we have to send a signal to linuxrc on s390 so that shutdown * can happen. this is ugly */ |