From fc2572f60b574cf5bc45f1c7b58698681f39ac50 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 14 Mar 2017 20:39:40 -0700 Subject: [PATCH] Remove chansrv_cleanup(), it doesn't do anything useful xrdp_chansrv_%8.8x_main_term and xrdp_chansrv_%8.8x_thread_done are both wait objects, not sockets. They are created and cleaned up in chansrv.c Wait objects are pairs of file descriptors on POSIX. They are closed automatically when the process exits. On Windows, wait objects are handles that are closed by CloseHandle(). Those handles should also be closed on the process exit. In any case, there is no way for a parent process to clean up file handles of the child process. --- sesman/sessvc/sessvc.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/sesman/sessvc/sessvc.c b/sesman/sessvc/sessvc.c index 2426b698..c247027c 100644 --- a/sesman/sessvc/sessvc.c +++ b/sesman/sessvc/sessvc.c @@ -48,30 +48,6 @@ nil_signal_handler(int sig) g_writeln("xrdp-sessvc: nil_signal_handler: got signal %d", sig); } -/******************************************************************************/ -/* chansrv can exit at any time without cleaning up, it's an xlib app */ -int -chansrv_cleanup(int pid) -{ - char text[256]; - - g_snprintf(text, 255, "/tmp/.xrdp/xrdp_chansrv_%8.8x_main_term", pid); - - if (g_file_exist(text)) - { - g_file_delete(text); - } - - g_snprintf(text, 255, "/tmp/.xrdp/xrdp_chansrv_%8.8x_thread_done", pid); - - if (g_file_exist(text)) - { - g_file_delete(text); - } - - return 0; -} - /******************************************************************************/ int main(int argc, char **argv) @@ -148,7 +124,6 @@ main(int argc, char **argv) g_sleep(1); } - chansrv_cleanup(chansrv_pid); /* kill X server */ g_writeln("xrdp-sessvc: stopping X server"); g_sigterm(x_pid);