diff --git a/unix/ux_x11.c b/unix/ux_x11.c index 91c95bbc..4df66d15 100644 --- a/unix/ux_x11.c +++ b/unix/ux_x11.c @@ -159,6 +159,11 @@ int platform_make_x11_server(Plug *plug, const char *progname, int mindisp, * we expect read() to return EOF as soon as * that process terminates. */ + + close(0); + close(1); + close(2); + setpgid(0, 0); close(cleanup_pipe[1]); close(authfd); diff --git a/unix/uxagentsock.c b/unix/uxagentsock.c index 90e701ff..3fbbb84f 100644 --- a/unix/uxagentsock.c +++ b/unix/uxagentsock.c @@ -62,6 +62,11 @@ Socket *platform_make_agent_socket( * we expect read() to return EOF as soon as * that process terminates. */ + + close(0); + close(1); + close(2); + setpgid(0, 0); close(cleanup_pipe[1]); while (read(cleanup_pipe[0], buf, sizeof(buf)) > 0);