Stefan Dirsch
64801441cd
* Reindent startx after !6 * Remove Xdmx from suggested Xserver list * Mark global variables as static since there's only one source file * Clear -Wunused-parameter warnings from clang * Use ptrdiff_t to store results of pointer subtraction * Use asprintf() if available * Don't exit with failure on SIGTERM regardless. * darwin: Remove bashism from 10-tmpdirs script * Modernized shell scripts * startx: Assign XSERVERRC to correct userserverrc * add closing quote to /dev/random mcookie hex - adjusted xinit-suse.patch - refreshed xinit-client-session.patch - refreshed xinit-tolerant-hostname-changes.patch OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xinit?expand=0&rev=71
41 lines
1.1 KiB
Diff
41 lines
1.1 KiB
Diff
Index: xinit-1.4.3/xinit.c
|
|
===================================================================
|
|
--- xinit-1.4.3.orig/xinit.c
|
|
+++ xinit-1.4.3/xinit.c
|
|
@@ -90,6 +90,7 @@ static char xserverrcbuf[256];
|
|
|
|
#define TRUE 1
|
|
#define FALSE 0
|
|
+#define ERR_EXIT 1
|
|
|
|
static char *default_server = "X";
|
|
static char *default_display = ":0"; /* choose most efficient */
|
|
@@ -570,6 +571,8 @@ startClient(char *client_argv[])
|
|
{
|
|
clientpid = fork();
|
|
if (clientpid == 0) {
|
|
+ int fd;
|
|
+
|
|
set_environment();
|
|
setWindowPath();
|
|
|
|
@@ -577,7 +580,17 @@ startClient(char *client_argv[])
|
|
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(ERR_EXIT);
|
|
+ }
|
|
+ close (STDIN_FILENO);
|
|
+ dup2 (fd, STDIN_FILENO);
|
|
+ close (fd);
|
|
+ setsid();
|
|
+
|
|
Execute(client_argv);
|
|
Error("Unable to run program \"%s\"", client_argv[0]);
|
|
|