diff options
author | Koichiro IWAO <meta@vmeta.jp> | 2017-07-04 17:05:00 +0900 |
---|---|---|
committer | metalefty <meta@vmeta.jp> | 2017-07-06 12:36:47 +0900 |
commit | 9065964bd96825fe3225c811c70da64365fa9ac6 (patch) | |
tree | 4930d971a03fa8def7c37c335f26a9838b9f59a5 | |
parent | 3a276318267821f0a93e12ecb3f32c7a0fe09bbd (diff) | |
download | xrdp-proprietary-9065964bd96825fe3225c811c70da64365fa9ac6.tar.gz xrdp-proprietary-9065964bd96825fe3225c811c70da64365fa9ac6.zip |
chansrv: include display number in chansrv log filename
since xrdp-chansrv may be run multiple instances per user. For example,
Xvnc backend creates one session per screen geometry.
-rw-r--r-- | sesman/chansrv/chansrv.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index 49b11448..9ae91f1b 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -1522,13 +1522,17 @@ main(int argc, char **argv) read_ini(); pid = g_getpid(); + display_text = g_getenv("DISPLAY"); + + if (display_text) + get_display_num_from_display(display_text); log_level = get_log_level(g_getenv("CHANSRV_LOG_LEVEL"), LOG_LEVEL_INFO); /* starting logging subsystem */ g_memset(&logconfig, 0, sizeof(struct log_config)); logconfig.program_name = "xrdp-chansrv"; - g_snprintf(log_file, 255, "%s/xrdp-chansrv.log", log_path); + g_snprintf(log_file, 255, "%s/xrdp-chansrv.%d.log", log_path, g_display_num); g_writeln("chansrv::main: using log file [%s]", log_file); if (g_file_exist(log_file)) @@ -1571,12 +1575,8 @@ main(int argc, char **argv) g_signal_child_stop(child_signal_handler); /* SIGCHLD */ g_signal_segfault(segfault_signal_handler); - display_text = g_getenv("DISPLAY"); LOGM((LOG_LEVEL_INFO, "main: DISPLAY env var set to %s", display_text)); - if (display_text) - get_display_num_from_display(display_text); - if (g_display_num == 0) { LOGM((LOG_LEVEL_ERROR, "main: error, display is zero")); |