]> git.ipfire.org Git - ipfire-3.x.git/blob - xorg-x11-xinit/patches/xinit-1.0.2-client-session.patch
xorg-x11-xinit: Update to 1.3.2.
[ipfire-3.x.git] / xorg-x11-xinit / patches / xinit-1.0.2-client-session.patch
1 Index: xinit-1.3.1/xinit.c
2 ===================================================================
3 --- xinit-1.3.1.orig/xinit.c
4 +++ xinit-1.3.1/xinit.c
5 @@ -91,6 +91,8 @@ char xserverrcbuf[256];
6
7 #define TRUE 1
8 #define FALSE 0
9 +#define OK_EXIT 0
10 +#define ERR_EXIT 1
11
12 static char *default_server = "X";
13 static char *default_display = ":0"; /* choose most efficient */
14 @@ -561,6 +563,7 @@ startClient(char *client[])
15 {
16 clientpid = fork();
17 if (clientpid == 0) {
18 + int fd;
19 set_environment();
20 setWindowPath();
21
22 @@ -568,7 +571,16 @@ startClient(char *client[])
23 Error("cannot change uid");
24 _exit(EXIT_FAILURE);
25 }
26 - setpgid(0, getpid());
27 + fd = open ("/dev/null", O_RDONLY);
28 +
29 + if (fd < 0) {
30 + Error("cannot open /dev/null: %s\n", strerror(errno));
31 + _exit(ERR_EXIT);
32 + }
33 + close (STDIN_FILENO);
34 + dup2 (fd, STDIN_FILENO);
35 + close (fd);
36 + setsid();
37 Execute(client);
38 Error("Unable to run program \"%s\"", client[0]);
39