mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-12 04:09:15 +00:00
Update to xserver 1.4.2. Tested by landry@, ckuethe@, jsing@ mbalmer@.
This commit is contained in:
@@ -285,7 +285,8 @@ OsSignal(sig, handler)
|
||||
sigaddset(&act.sa_mask, sig);
|
||||
act.sa_flags = 0;
|
||||
act.sa_handler = handler;
|
||||
sigaction(sig, &act, &oact);
|
||||
if (sigaction(sig, &act, &oact))
|
||||
perror("sigaction");
|
||||
return oact.sa_handler;
|
||||
#endif
|
||||
}
|
||||
@@ -1703,6 +1704,10 @@ System(char *command)
|
||||
|
||||
#ifdef SIGCHLD
|
||||
csig = signal(SIGCHLD, SIG_DFL);
|
||||
if (csig == SIG_ERR) {
|
||||
perror("signal");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1727,7 +1732,10 @@ System(char *command)
|
||||
}
|
||||
|
||||
#ifdef SIGCHLD
|
||||
signal(SIGCHLD, csig);
|
||||
if (signal(SIGCHLD, csig) == SIG_ERR) {
|
||||
perror("signal");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return p == -1 ? -1 : status;
|
||||
@@ -1739,6 +1747,8 @@ static struct pid {
|
||||
int pid;
|
||||
} *pidlist;
|
||||
|
||||
void (*old_alarm)(int) = NULL; /* XXX horrible awful hack */
|
||||
|
||||
pointer
|
||||
Popen(char *command, char *type)
|
||||
{
|
||||
@@ -1760,11 +1770,20 @@ Popen(char *command, char *type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Ignore the smart scheduler while this is going on */
|
||||
old_alarm = signal(SIGALRM, SIG_IGN);
|
||||
if (old_alarm == SIG_ERR) {
|
||||
perror("signal");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (pid = fork()) {
|
||||
case -1: /* error */
|
||||
close(pdes[0]);
|
||||
close(pdes[1]);
|
||||
xfree(cur);
|
||||
if (signal(SIGALRM, old_alarm) == SIG_ERR)
|
||||
perror("signal");
|
||||
return NULL;
|
||||
case 0: /* child */
|
||||
if (setgid(getgid()) == -1)
|
||||
@@ -1940,6 +1959,11 @@ Pclose(pointer iop)
|
||||
/* allow EINTR again */
|
||||
OsReleaseSignals ();
|
||||
|
||||
if (old_alarm && signal(SIGALRM, old_alarm) == SIG_ERR) {
|
||||
perror("signal");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return pid == -1 ? -1 : pstat;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user