[gnome-session] xsmp-server: guard against EINTR on IceLockAuthFile



commit 5bfbd5c477b890bd792f7b058eff13815497d8bd
Author: Ray Strode <rstrode redhat com>
Date:   Thu Jun 14 15:08:47 2012 -0400

    xsmp-server: guard against EINTR on IceLockAuthFile
    
    Matthias is seeing a mysterious, but very intermittent
    error dialog where IceLockAuthFile is apparently dying.  Looking at the
    libICE source, it doesn't protect itself against EINTR, which could
    possibly explain the failure.
    
    Gaurd against EINTR from our side in case that's the problem.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678122

 gnome-session/gsm-xsmp-server.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gnome-session/gsm-xsmp-server.c b/gnome-session/gsm-xsmp-server.c
index 1f0e045..449243a 100644
--- a/gnome-session/gsm-xsmp-server.c
+++ b/gnome-session/gsm-xsmp-server.c
@@ -22,6 +22,7 @@
 
 #include "config.h"
 
+#include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -438,13 +439,20 @@ update_iceauthority (GsmXsmpServer *server,
         GSList           *entries;
         GSList           *e;
         int               i;
+        int               ret;
         gboolean          ok = FALSE;
 
         filename = IceAuthFileName ();
-        if (IceLockAuthFile (filename,
-                             GSM_ICE_AUTH_RETRIES,
-                             GSM_ICE_AUTH_INTERVAL,
-                             GSM_ICE_AUTH_LOCK_TIMEOUT) != IceAuthLockSuccess) {
+        do {
+                ret = IceLockAuthFile (filename,
+                                       GSM_ICE_AUTH_RETRIES,
+                                       GSM_ICE_AUTH_INTERVAL,
+                                       GSM_ICE_AUTH_LOCK_TIMEOUT);
+
+        } while (ret != IceAuthLockSuccess && errno == EINTR);
+
+        if (ret != IceAuthLockSuccess) {
+                g_warning ("IceLockAuthFile failed: %m");
                 return FALSE;
         }
 



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