diff options
author | Christopher Faylor <me@cgf.cx> | 2006-03-22 04:13:55 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-03-22 04:13:55 +0000 |
commit | 70fde4154fc4b24af9abaf0a335f06952698852c (patch) | |
tree | a9d96cb52de50ecc7b1da29dbd20f70829642d5c | |
parent | 76ef40d69f3651f01b3e2ffdeb470593d62e04b0 (diff) | |
download | cygnal-70fde4154fc4b24af9abaf0a335f06952698852c.tar.gz cygnal-70fde4154fc4b24af9abaf0a335f06952698852c.tar.bz2 cygnal-70fde4154fc4b24af9abaf0a335f06952698852c.zip |
* signal.cc (signal): Don't set SA_RESTART here.
(siginterrupt): White space.
* sigproc.cc (sigalloc): Set SA_RESTART here, on initialization.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/signal.cc | 7 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.cc | 4 |
3 files changed, 12 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a628eb518..62fc86486 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,11 @@ 2006-03-21 Christopher Faylor <cgf@timesys.com> + * signal.cc (signal): Don't set SA_RESTART here. + (siginterrupt): White space. + * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization. + +2006-03-21 Christopher Faylor <cgf@timesys.com> + * child_info.h (child_status): Fix typo which made it impossible to set iscygwin. (child_info::isstraced): Booleanize. diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 1055b5fe9..6a7edd914 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -64,10 +64,7 @@ signal (int sig, _sig_func_ptr func) prev = global_sigs[sig].sa_handler; global_sigs[sig].sa_handler = func; global_sigs[sig].sa_mask = 0; - /* SA_RESTART is set to maintain BSD compatible signal behaviour by default. - This is also compatible with the behaviour of signal(2) in Linux. */ - global_sigs[sig].sa_flags |= SA_RESTART; - global_sigs[sig].sa_flags &= ~ SA_SIGINFO; + global_sigs[sig].sa_flags &= ~SA_SIGINFO; set_sigcatchers (prev, func); syscall_printf ("%p = signal (%d, %p)", prev, sig, func); @@ -470,7 +467,7 @@ extern "C" int siginterrupt (int sig, int flag) { struct sigaction act; - sigaction(sig, NULL, &act); + sigaction (sig, NULL, &act); if (flag) act.sa_flags &= ~SA_RESTART; else diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 51c756934..1adbb9f21 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -113,6 +113,10 @@ sigalloc () cygheap->sigs = global_sigs = (struct sigaction *) ccalloc (HEAP_SIGS, NSIG, sizeof (struct sigaction)); global_sigs[SIGSTOP].sa_flags = SA_RESTART | SA_NODEFER; + for (int i = 0; i < NSIG; i++) + /* SA_RESTART is set to maintain BSD compatible signal behaviour by default. + This is also compatible with the behaviour of signal(2) in Linux. */ + global_sigs[i].sa_flags = SA_RESTART; } void __stdcall |