Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: fusl/src/signal/sigset.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/signal/sigrtmin.c ('k') | fusl/src/signal/sigsetjmp.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <signal.h>
2
3 void (*sigset(int sig, void (*handler)(int)))(int)
4 {
5 struct sigaction sa, sa_old;
6 sigset_t mask;
7
8 sigemptyset(&mask);
9 if (sigaddset(&mask, sig) < 0)
10 return SIG_ERR;
11
12 if (handler == SIG_HOLD) {
13 if (sigaction(sig, 0, &sa_old) < 0)
14 return SIG_ERR;
15 if (sigprocmask(SIG_BLOCK, &mask, &mask) < 0)
16 return SIG_ERR;
17 } else {
18 sa.sa_handler = handler;
19 sa.sa_flags = 0;
20 sigemptyset(&sa.sa_mask);
21 if (sigaction(sig, &sa, &sa_old) < 0)
22 return SIG_ERR;
23 if (sigprocmask(SIG_UNBLOCK, &mask, &mask) < 0)
24 return SIG_ERR;
25 }
26 return sigismember(&mask, sig) ? SIG_HOLD : sa_old.sa_handler;
27 }
OLDNEW
« no previous file with comments | « fusl/src/signal/sigrtmin.c ('k') | fusl/src/signal/sigsetjmp.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698