[gdm/display-configuration] Fix dead-waiting for last commit, we try to wait 5 seconds.



commit ac59f33080692222bc8e24f59d12d4bbec2f7931
Author: Halton Huo <halton huo sun com>
Date:   Fri Nov 27 23:20:52 2009 +0800

    Fix dead-waiting for last commit, we try to wait 5 seconds.

 daemon/gdm-server.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
index 6408d04..757ef62 100644
--- a/daemon/gdm-server.c
+++ b/daemon/gdm-server.c
@@ -630,6 +630,7 @@ gdm_server_spawn (GdmServer  *server,
         if ((tmp = strstr (server->priv->display_name, ":")) != NULL) {
                 char *socket_file;
                 int   display_num;
+                int   count;
                 char *p;
 
                 tmp++;
@@ -637,10 +638,12 @@ gdm_server_spawn (GdmServer  *server,
 
                 socket_file = g_strdup_printf ("/tmp/.X11-unix/X%d",
                                                display_num);
-                while (1) {
+                count = 0;
+                while (count < 5) {
                         if (!g_file_test (socket_file, G_FILE_TEST_EXISTS))
                                 break;
                         sleep (1);
+                        count ++;
                 }
                 g_free (socket_file);
         }



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