mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-28 16:50:13 +01:00
Use OsSignal in Popen/Pclose to avoid SysV signal() stupidity
(cherry picked from commit c9051b684b)
This commit is contained in:
parent
244e960bb0
commit
1e3f8913c5
1 changed files with 4 additions and 4 deletions
|
|
@ -1702,7 +1702,7 @@ static struct pid {
|
|||
int pid;
|
||||
} *pidlist;
|
||||
|
||||
void (*old_alarm)(int) = NULL; /* XXX horrible awful hack */
|
||||
OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */
|
||||
|
||||
pointer
|
||||
Popen(char *command, char *type)
|
||||
|
|
@ -1726,7 +1726,7 @@ Popen(char *command, char *type)
|
|||
}
|
||||
|
||||
/* Ignore the smart scheduler while this is going on */
|
||||
old_alarm = signal(SIGALRM, SIG_IGN);
|
||||
old_alarm = OsSignal(SIGALRM, SIG_IGN);
|
||||
if (old_alarm == SIG_ERR) {
|
||||
perror("signal");
|
||||
return NULL;
|
||||
|
|
@ -1737,7 +1737,7 @@ Popen(char *command, char *type)
|
|||
close(pdes[0]);
|
||||
close(pdes[1]);
|
||||
xfree(cur);
|
||||
if (signal(SIGALRM, old_alarm) == SIG_ERR)
|
||||
if (OsSignal(SIGALRM, old_alarm) == SIG_ERR)
|
||||
perror("signal");
|
||||
return NULL;
|
||||
case 0: /* child */
|
||||
|
|
@ -1914,7 +1914,7 @@ Pclose(pointer iop)
|
|||
/* allow EINTR again */
|
||||
OsReleaseSignals ();
|
||||
|
||||
if (old_alarm && signal(SIGALRM, old_alarm) == SIG_ERR) {
|
||||
if (old_alarm && OsSignal(SIGALRM, old_alarm) == SIG_ERR) {
|
||||
perror("signal");
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue