summaryrefslogtreecommitdiffstats
path: root/sesman/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'sesman/session.c')
-rw-r--r--sesman/session.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sesman/session.c b/sesman/session.c
index 2a96392f..08e5efad 100644
--- a/sesman/session.c
+++ b/sesman/session.c
@@ -256,7 +256,20 @@ for user %s denied", username);
else if (wmpid == 0) /* child (child sesman) xserver */
{
/* give X a bit to start */
- g_sleep(1000);
+ /* wait up to 10 secs for x server to start */
+ i = 0;
+ while (!x_server_running(display))
+ {
+ i++;
+ if (i > 40)
+ {
+ log_message(&(g_cfg->log), LOG_LEVEL_ERROR,
+ "X server for display %d startup timeout",
+ display);
+ break;
+ }
+ g_sleep(250);
+ }
env_set_user(username, 0, display);
if (x_server_running(display))
{