5f3c52
diff -up xinit-1.3.4/xinit.c.client-session xinit-1.3.4/xinit.c
5f3c52
--- xinit-1.3.4/xinit.c.client-session	2014-03-25 10:20:26.000000000 +0100
5f3c52
+++ xinit-1.3.4/xinit.c	2014-09-11 17:03:30.928360694 +0200
5f3c52
@@ -89,6 +89,8 @@ char xserverrcbuf[256];
5f3c52
 
5f3c52
 #define TRUE 1
5f3c52
 #define FALSE 0
5f3c52
+#define OK_EXIT 0
5f3c52
+#define ERR_EXIT 1
5f3c52
 
5f3c52
 static char *default_server = "X";
5f3c52
 static char *default_display = ":0";        /* choose most efficient */
5f3c52
@@ -560,6 +562,7 @@ startClient(char *client_argv[])
5f3c52
 {
5f3c52
     clientpid = fork();
5f3c52
     if (clientpid == 0) {
5f3c52
+        int fd;
5f3c52
         set_environment();
5f3c52
         setWindowPath();
5f3c52
 
5f3c52
@@ -567,7 +570,16 @@ startClient(char *client_argv[])
5f3c52
             Error("cannot change uid");
5f3c52
             _exit(EXIT_FAILURE);
5f3c52
         }
5f3c52
-        setpgid(0, getpid());
5f3c52
+        fd = open ("/dev/null", O_RDONLY);
5f3c52
+
5f3c52
+        if (fd < 0) {
5f3c52
+            Error("cannot open /dev/null: %s\n", strerror(errno));
5f3c52
+            _exit(ERR_EXIT);
5f3c52
+        }
5f3c52
+        close (STDIN_FILENO);
5f3c52
+        dup2 (fd, STDIN_FILENO);
5f3c52
+        close (fd);
5f3c52
+        setsid();
5f3c52
         Execute(client_argv);
5f3c52
         Error("Unable to run program \"%s\"", client_argv[0]);
5f3c52