[PATCH 1/2] Adapt standalone shutdown to nokill changes so s390x can use it. (#528380)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The support for boot option "nokill" in shutdown by
ade8105a8515afee24220fd0cc1199e30c1c3142 did not adapt the
standalone version of shutdown (#ifdef AS_SHUTDOWN) so doKill
was always 0. Introduce a new command line option "--nokill" and
otherwise default to doKill=1. While we're at it also provide
a command line option "-P" for poweroff.
---
 loader/shutdown.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/loader/shutdown.c b/loader/shutdown.c
index 6a32e79..c733f86 100644
--- a/loader/shutdown.c
+++ b/loader/shutdown.c
@@ -125,12 +125,17 @@ void shutDown(int doKill, reboot_action rebootAction) {
 #ifdef AS_SHUTDOWN
 int main(int argc, char ** argv) {
     int fd;
-    int doReboot = 0;
+    reboot_action rebootAction = HALT;
+    int doKill = 1;
     int i = 1;
 
     while (i < argc) {
       if (!strncmp("-r", argv[i], 2))
-	doReboot = 1;
+        rebootAction = REBOOT;
+      else if (!strncmp("--nokill", argv[i], 8))
+        doKill = 0;
+      else if (!strncmp("-P", argv[i], 2))
+        rebootAction = POWEROFF;
       i++;
     }
 
@@ -148,7 +153,7 @@ int main(int argc, char ** argv) {
     dup2(fd, 2);
     close(fd);
 
-    shutDown(0, doReboot ? REBOOT : HALT);
+    shutDown(doKill, rebootAction);
     return 0;
 }
 #endif
-- 
1.6.5


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux