diff --git a/xinit.c b/xinit.c index 0d31637..b5a1ca8 100644 --- a/xinit.c +++ b/xinit.c @@ -562,6 +562,7 @@ startClient(char *client[]) { clientpid = fork(); if (clientpid == 0) { + int fd; set_environment(); setWindowPath(); @@ -569,7 +570,18 @@ startClient(char *client[]) Error("cannot change uid"); _exit(EXIT_FAILURE); } - setpgid(0, getpid()); + + fd = open ("/dev/null", O_RDONLY); + + if (fd < 0) { + Error("cannot open /dev/null: %s\n", strerror(errno)); + _exit(EXIT_FAILURE); + } + close (STDIN_FILENO); + dup2 (fd, STDIN_FILENO); + close (fd); + setsid(); + Execute(client); Error("Unable to run program \"%s\"", client[0]);