summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2008-12-29 04:24:51 +0000
committerjsorg71 <jsorg71>2008-12-29 04:24:51 +0000
commit6f169002edd4e793deca6173172329aa35cd2128 (patch)
treee3274c62bf71b42691a8b7aa2b029d29e595b3e8 /sesman
parent13ac4186c67e1373ab6271aef054315279b99b8b (diff)
downloadxrdp-proprietary-6f169002edd4e793deca6173172329aa35cd2128.tar.gz
xrdp-proprietary-6f169002edd4e793deca6173172329aa35cd2128.zip
improve the wait for the x server to start
Diffstat (limited to 'sesman')
-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))
{