Revision 10989,
1013 bytes
checked in by iwaim, 7 years ago
(diff) |
xorg-x11-xinit: add flies
|
-
old
|
new
|
char xserverrcbuf[256]; |
89 | 89 | |
90 | 90 | #define TRUE 1 |
91 | 91 | #define FALSE 0 |
| 92 | #define ERR_EXIT 1 |
92 | 93 | |
93 | 94 | static char *default_server = "X"; |
94 | 95 | static char *default_display = ":0"; /* choose most efficient */ |
… |
… |
startClient(char *client_argv[]) |
560 | 561 | { |
561 | 562 | clientpid = fork(); |
562 | 563 | if (clientpid == 0) { |
| 564 | int fd; |
563 | 565 | set_environment(); |
564 | 566 | setWindowPath(); |
565 | 567 | |
… |
… |
startClient(char *client_argv[]) |
567 | 569 | Error("cannot change uid"); |
568 | 570 | _exit(EXIT_FAILURE); |
569 | 571 | } |
570 | | setpgid(0, getpid()); |
| 572 | |
| 573 | fd = open ("/dev/null", O_RDONLY); |
| 574 | |
| 575 | if (fd < 0) { |
| 576 | Error("cannot open /dev/null: %s\n", strerror(errno)); |
| 577 | _exit(ERR_EXIT); |
| 578 | } |
| 579 | close (STDIN_FILENO); |
| 580 | dup2 (fd, STDIN_FILENO); |
| 581 | close (fd); |
| 582 | setsid(); |
| 583 | |
571 | 584 | Execute(client_argv); |
572 | 585 | Error("Unable to run program \"%s\"", client_argv[0]); |
573 | 586 | |
Note: See
TracBrowser
for help on using the repository browser.