From 727012a56f65fdeced100005887ad62698c0c759 Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Fri, 4 Sep 2009 19:20:40 +0000 Subject: [PATCH] added chansrv_cleanup --- sesman/sessvc/sessvc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sesman/sessvc/sessvc.c b/sesman/sessvc/sessvc.c index b5cbe4f0..29df1618 100644 --- a/sesman/sessvc/sessvc.c +++ b/sesman/sessvc/sessvc.c @@ -49,6 +49,26 @@ 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, its an xlib app */ +int APP_CC +chansrv_cleanup(int pid) +{ + char text[256]; + + g_snprintf(text, 255, "xrdp_chansrv_%8.8x_main_term", pid); + if (g_file_exist(text)) + { + g_file_delete(text); + } + g_snprintf(text, 255, "xrdp_chansrv_%8.8x_thread_done", pid); + if (g_file_exist(text)) + { + g_file_delete(text); + } + return 0; +} + /******************************************************************************/ int DEFAULT_CC main(int argc, char** argv) @@ -110,6 +130,7 @@ main(int argc, char** argv) { ret = g_waitpid(chansrv_pid); } + chansrv_cleanup(chansrv_pid); /* kill X server */ g_writeln("xrdp-sessvc: stopping X server"); g_sigterm(x_pid);