summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2010-07-26 03:32:52 +0000
committerjsorg71 <jsorg71>2010-07-26 03:32:52 +0000
commit8f6ac8df5c469338708407e2aa866ec812525040 (patch)
treebfe301a3b227a60189df555a84b2a5a9c4a0ed45 /xrdp/xrdp.c
parentb7cbc6a6566c7011e65e402d48e422d291257756 (diff)
downloadxrdp-proprietary-8f6ac8df5c469338708407e2aa866ec812525040.tar.gz
xrdp-proprietary-8f6ac8df5c469338708407e2aa866ec812525040.zip
write to pid file as early as possible
Diffstat (limited to 'xrdp/xrdp.c')
-rw-r--r--xrdp/xrdp.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c
index c354be6b..6f55420c 100644
--- a/xrdp/xrdp.c
+++ b/xrdp/xrdp.c
@@ -542,17 +542,6 @@ main(int argc, char** argv)
/* exit, this is the main process */
g_exit(0);
}
- g_sleep(1000);
- g_file_close(0);
- g_file_close(1);
- g_file_close(2);
- g_file_open("/dev/null");
- g_file_open("/dev/null");
- g_file_open("/dev/null");
- /* end of daemonizing code */
- }
- if (!no_daemon)
- {
/* write the pid to file */
pid = g_getpid();
fd = g_file_open(pid_file); /* xrdp.pid */
@@ -568,6 +557,14 @@ main(int argc, char** argv)
g_file_write(fd, text, g_strlen(text));
g_file_close(fd);
}
+ g_sleep(1000);
+ g_file_close(0);
+ g_file_close(1);
+ g_file_close(2);
+ g_file_open("/dev/null");
+ g_file_open("/dev/null");
+ g_file_open("/dev/null");
+ /* end of daemonizing code */
}
#endif
g_threadid = tc_get_threadid();