mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
Re-add SA_RESTART to mysignal.
This makes mysignal implement reliable BSD semantics according to Stevens' APUE. This was first attempted in 2001 but was reverted due to problems with HP-UX 10.20 and select() and possibly grantpt(). Modern systems should be fine with it, but if any current platforms have a problem with it now we can disable it just for those. ok djm@
This commit is contained in:
parent
0bd312a362
commit
9b9e3ca694
@ -37,10 +37,15 @@ mysignal(int sig, mysig_t act)
|
|||||||
memset(&sa, 0, sizeof(sa));
|
memset(&sa, 0, sizeof(sa));
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
|
if (sig == SIGALRM) {
|
||||||
#ifdef SA_INTERRUPT
|
#ifdef SA_INTERRUPT
|
||||||
if (sig == SIGALRM)
|
|
||||||
sa.sa_flags |= SA_INTERRUPT;
|
sa.sa_flags |= SA_INTERRUPT;
|
||||||
#endif
|
#endif
|
||||||
|
} else {
|
||||||
|
#ifdef SA_RESTART
|
||||||
|
sa.sa_flags |= SA_RESTART;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
sa.sa_handler = act;
|
sa.sa_handler = act;
|
||||||
if (sigaction(sig, &sa, NULL) == -1)
|
if (sigaction(sig, &sa, NULL) == -1)
|
||||||
return (mysig_t) -1;
|
return (mysig_t) -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user