[Xfce4-commits] r29429 - in xfce4-session/trunk: . xfce4-session

Brian Tarricone kelnos at xfce.org
Mon Feb 2 07:11:53 CET 2009


Author: kelnos
Date: 2009-02-02 06:11:53 +0000 (Mon, 02 Feb 2009)
New Revision: 29429

Modified:
   xfce4-session/trunk/ChangeLog
   xfce4-session/trunk/NEWS
   xfce4-session/trunk/xfce4-session/xfsm-shutdown-helper.c
Log:
	* xfce4-session/xfsm-shutdown-helper.c: Fix sudo shutdown helper;
	  use the correct offset into the command string table.  Also
	  ignore EINTR on errors, as the shutdown helper sometimes gets
	  killed before replying to the SM (bug 4849).

Modified: xfce4-session/trunk/ChangeLog
===================================================================
--- xfce4-session/trunk/ChangeLog	2009-02-02 05:57:54 UTC (rev 29428)
+++ xfce4-session/trunk/ChangeLog	2009-02-02 06:11:53 UTC (rev 29429)
@@ -1,5 +1,12 @@
-2009-10-26	Brian Tarricone <bjt23 at cornell.edu>
+2009-02-01	Brian Tarricone <bjt23 at cornell.edu>
 
+	* xfce4-session/xfsm-shutdown-helper.c: Fix sudo shutdown helper;
+	  use the correct offset into the command string table.  Also
+	  ignore EINTR on errors, as the shutdown helper sometimes gets
+	  killed before replying to the SM (bug 4849).
+
+2009-01-26	Brian Tarricone <bjt23 at cornell.edu>
+
 	* xfce4-session/main.c: Respect the ICEAUTHORITY environment
 	  variable (bug 4369).
 

Modified: xfce4-session/trunk/NEWS
===================================================================
--- xfce4-session/trunk/NEWS	2009-02-02 05:57:54 UTC (rev 29428)
+++ xfce4-session/trunk/NEWS	2009-02-02 06:11:53 UTC (rev 29429)
@@ -2,6 +2,9 @@
 ======================
 
 - Respect the ICEAUTHORITY env var (bug 4369).
+- Fix sudo shutdown helper for sysetms without HAL (bug 4849).
+- Avoid a spurious error dialog when using the sudo shutdown helper
+  to shut down the system (bug 4849).
 
 4.5.99.1 (Xfce 4.6rc1)
 ======================

Modified: xfce4-session/trunk/xfce4-session/xfsm-shutdown-helper.c
===================================================================
--- xfce4-session/trunk/xfce4-session/xfsm-shutdown-helper.c	2009-02-02 05:57:54 UTC (rev 29428)
+++ xfce4-session/trunk/xfce4-session/xfsm-shutdown-helper.c	2009-02-02 06:11:53 UTC (rev 29429)
@@ -547,12 +547,14 @@
         }
 
       /* send it to our associated sudo'ed process */
-      fprintf (helper->outfile, "%s\n", command_table[command]);
+      /* -2 is not a magic number, it's to get the right offset in command_table array */
+      /* because in enum, XFSM_SHUTDOWN_HALT = 2 and XFSM_SHUTDOWN_REBOOT = 3 */
+      fprintf (helper->outfile, "%s\n", command_table[command - 2]);
       fflush (helper->outfile);
 
       if (ferror (helper->outfile))
         {
-          if (error)
+          if (error && errno != EINTR)
             {
               g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
                            _("Error sending command to shutdown helper: %s"),
@@ -563,7 +565,7 @@
 
       if (fgets (response, 256, helper->infile) == NULL)
         {
-          if (error)
+          if (error && errno != EINTR)
             {
               g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
                            _("Error receiving response from shutdown helper: %s"),




More information about the Xfce4-commits mailing list