source: projects/specs/trunk/x/xorg-x11-xinit/xinit-1.3.4-client-session.patch @ 10989

Revision 10989, 1013 bytes checked in by iwaim, 7 years ago (diff)

xorg-x11-xinit: add flies

RevLine 
[10989]1--- xinit-1.3.4/xinit.c.client-session  2014-03-25 18:20:26.000000000 +0900
2+++ xinit-1.3.4/xinit.c 2014-11-22 20:11:16.301390109 +0900
3@@ -89,6 +89,7 @@ char xserverrcbuf[256];
4 
5 #define TRUE 1
6 #define FALSE 0
7+#define ERR_EXIT 1
8 
9 static char *default_server = "X";
10 static char *default_display = ":0";        /* choose most efficient */
11@@ -560,6 +561,7 @@ startClient(char *client_argv[])
12 {
13     clientpid = fork();
14     if (clientpid == 0) {
15+               int fd;
16         set_environment();
17         setWindowPath();
18 
19@@ -567,7 +569,18 @@ startClient(char *client_argv[])
20             Error("cannot change uid");
21             _exit(EXIT_FAILURE);
22         }
23-        setpgid(0, getpid());
24+
25+               fd = open ("/dev/null", O_RDONLY);
26+
27+               if (fd < 0) {
28+                       Error("cannot open /dev/null: %s\n", strerror(errno));
29+                       _exit(ERR_EXIT);
30+               }
31+               close (STDIN_FILENO);
32+               dup2 (fd, STDIN_FILENO);
33+               close (fd);
34+               setsid();
35+
36         Execute(client_argv);
37         Error("Unable to run program \"%s\"", client_argv[0]);
38 
Note: See TracBrowser for help on using the repository browser.