Re: [PATCH 3/3] Handle reboot better on s390 (#533198)

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

 



Hi,

On 01/19/2010 03:43 AM, David Cantrell wrote:
Do not install a handler for SIGINT on s390 since you can't really press
Ctrl+Alt+Del there.  Only handle SIGUSR1 and SIGUSR2 as handled in
linuxrc.s390 (which comes from loader which comes from iutil.py).
Always make sure we unmount filesystems and kill off processes, then
reboot if that's requested or exit and display the halt message.
---
  loader/shutdown.c |   29 ++++++-----------------------
  1 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/loader/shutdown.c b/loader/shutdown.c
index 8f2c55e..7ab8195 100644
--- a/loader/shutdown.c
+++ b/loader/shutdown.c
@@ -84,36 +84,19 @@ static void performReboot(reboot_action rebootAction) {
  	}
  }

-int shouldReboot = 0;
-
-static void rebootHandler(int signum) {
-    shouldReboot = 1;
-}
-
  void shutDown(int doKill, reboot_action rebootAction) {
-	if (rebootAction == POWEROFF || rebootAction == REBOOT) {
+	if (doKill) {
  		performUnmounts(doKill);
  		performTerminations(doKill);
-		if (doKill)
-			performReboot(rebootAction);
  	}

-	if (!shouldReboot&&  rebootAction != REBOOT)
-		printf("you may safely reboot your system\n");
-	
-    signal(SIGINT, rebootHandler);
-	while (1) {
-		if (shouldReboot) {
-			performUnmounts(1);
-			performTerminations(1);
-			performReboot(REBOOT);
-		}
-		sleep(1);
+	if ((rebootAction == POWEROFF || rebootAction == REBOOT)&&  doKill) {
+		performReboot(rebootAction);
  	}

-    exit(0);
-
-    return;
+	printf("you may safely reboot your system\n");
+	exit(0);
+	return;
  }

  #ifdef AS_SHUTDOWN

As this changes the only caller of performUnmounts and performTerminations, and
puts their calls in an "if (doKill)" block, you might just as well remove
the doKill parameter from performUnmounts and performTerminations (and
remove the check in there).

Regards,

Hans

_______________________________________________
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