X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fsignal%2Fsigaction.c;h=c109bea0cfe360ce4191a175c1e561c2d7fb6419;hb=a56ec7e8e27c4e8bb7aa7d612bf382b4bafb132f;hp=2adedaa4711cfcc69fb1b4980022b8121bf87c53;hpb=9b95fd0944e4206949e90633c3fed088202810ec;p=musl diff --git a/src/signal/sigaction.c b/src/signal/sigaction.c index 2adedaa4..c109bea0 100644 --- a/src/signal/sigaction.c +++ b/src/signal/sigaction.c @@ -4,9 +4,10 @@ #include "syscall.h" #include "pthread_impl.h" #include "libc.h" +#include "lock.h" #include "ksigaction.h" -volatile int dummy_lock[1] = { 0 }; +static volatile int dummy_lock[1] = { 0 }; extern hidden volatile int __abort_lock[1]; @@ -20,6 +21,8 @@ void __get_handler_set(sigset_t *set) memcpy(set, handler_set, sizeof handler_set); } +volatile int __eintr_valid_flag; + int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old) { struct k_sigaction ksa, ksa_old; @@ -42,6 +45,10 @@ int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigact SIGPT_SET, 0, _NSIG/8); unmask_done = 1; } + + if (!(sa->sa_flags & SA_RESTART)) { + a_store(&__eintr_valid_flag, 1); + } } /* Changing the disposition of SIGABRT to anything but * SIG_DFL requires a lock, so that it cannot be changed