diff options
author | jsorg71 <jsorg71> | 2009-08-06 19:01:09 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2009-08-06 19:01:09 +0000 |
commit | 9922d2aef644c32b849b317ca4468d7c248ffbef (patch) | |
tree | 1801b49f98c681d6f8963acbdfdd50fb6bccf07c /sesman/session.c | |
parent | c85e32446c68eb5af3c9752efcf7054a4892e32d (diff) | |
download | xrdp-proprietary-9922d2aef644c32b849b317ca4468d7c248ffbef.tar.gz xrdp-proprietary-9922d2aef644c32b849b317ca4468d7c248ffbef.zip |
added x_server_running_check_ports
Diffstat (limited to 'sesman/session.c')
-rw-r--r-- | sesman/session.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/sesman/session.c b/sesman/session.c index 68f45693..29caeac4 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -85,7 +85,7 @@ session_get_bydata(char* name, int width, int height, int bpp) * */ static int DEFAULT_CC -x_server_running(int display) +x_server_running_check_ports(int display) { char text[256]; int x_running; @@ -123,6 +123,31 @@ x_server_running(int display) } /******************************************************************************/ +/** + * + * @brief checks if there's a server running on a display + * @param display the display to check + * @return 0 if there isn't a display running, nonzero otherwise + * + */ +static int DEFAULT_CC +x_server_running(int display) +{ + char text[256]; + int x_running; + int sck; + + g_sprintf(text, "/tmp/.X11-unix/X%d", display); + x_running = g_file_exist(text); + if (!x_running) + { + g_sprintf(text, "/tmp/.X%d-lock", display); + x_running = g_file_exist(text); + } + return x_running; +} + +/******************************************************************************/ static void DEFAULT_CC session_start_sessvc(int xpid, int wmpid, long data) { @@ -215,7 +240,7 @@ session_get_aval_display_from_chain(void) { if (!session_is_display_in_chain(display)) { - if (!x_server_running(display)) + if (!x_server_running_check_ports(display)) { lock_chain_release(); return display; |