Skip to content

[pull] devel from neutrinolabs:devel #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions sesman/chansrv/chansrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,13 @@ main(int argc, char **argv)
return 1;
}

/* set up signal handler */
/* set up signal objects */
g_snprintf(text, sizeof(text), "xrdp_chansrv_%8.8x_main_term", pid);
g_term_event = g_create_wait_obj(text);
g_snprintf(text, sizeof(text), "xrdp_chansrv_%8.8x_sigchld", pid);
g_sigchld_event = g_create_wait_obj(text);

/* set up signal handlers */
g_signal_terminate(term_signal_handler); /* SIGTERM */
g_signal_user_interrupt(term_signal_handler); /* SIGINT */
g_signal_pipe(nil_signal_handler); /* SIGPIPE */
Expand All @@ -1945,18 +1951,17 @@ main(int argc, char **argv)
xcommon_set_x_server_fatal_handler(x_server_fatal_handler);

LOG_DEVEL(LOG_LEVEL_INFO, "main: DISPLAY env var set to %s", display_text);

LOG_DEVEL(LOG_LEVEL_INFO, "main: using DISPLAY %d", g_display_num);
g_snprintf(text, 255, "xrdp_chansrv_%8.8x_main_term", pid);
g_term_event = g_create_wait_obj(text);
g_snprintf(text, 255, "xrdp_chansrv_%8.8x_sigchld", pid);
g_sigchld_event = g_create_wait_obj(text);
g_snprintf(text, 255, "xrdp_chansrv_%8.8x_thread_done", pid);
g_thread_done_event = g_create_wait_obj(text);
g_snprintf(text, 255, "xrdp_chansrv_%8.8x_exec", pid);

/* Set up RAIL sync objects */
g_snprintf(text, sizeof(text), "xrdp_chansrv_%8.8x_exec", pid);
g_exec_event = g_create_wait_obj(text);
g_exec_mutex = tc_mutex_create();
g_exec_sem = tc_sem_create(0);

/* Set up the channel thread */
g_snprintf(text, sizeof(text), "xrdp_chansrv_%8.8x_thread_done", pid);
g_thread_done_event = g_create_wait_obj(text);
tc_thread_create(channel_thread_loop, 0);

while (g_term_event > 0 && !g_is_wait_obj_set(g_term_event))
Expand Down