mailing list of musl libc
 help / color / mirror / code / Atom feed
6da6074dc57a78fabfba48a702ad34b460c181f6 blob 648 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
#include <signal.h>

void (*sigset(int sig, void (*handler)(int)))(int)
{
	struct sigaction sa, sa_old;
	sigset_t mask, mask_old;

	sigemptyset(&mask);
	if (sigaddset(&mask, sig) < 0)
		return SIG_ERR;

	if (handler == SIG_HOLD) {
		if (sigaction(sig, 0, &sa_old) < 0)
			return SIG_ERR;
		if (sigprocmask(SIG_BLOCK, &mask, &mask_old) < 0)
			return SIG_ERR;
	} else {
		sa.sa_handler = handler;
		sa.sa_flags = 0;
		sigemptyset(&sa.sa_mask);
		if (sigaction(sig, &sa, &sa_old) < 0)
			return SIG_ERR;
		if (sigprocmask(SIG_UNBLOCK, &mask, &mask_old) < 0)
			return SIG_ERR;
	}
	return sigismember(&mask_old, sig) ? SIG_HOLD : sa_old.sa_handler;
}
debug log:

solving 6da6074d ...
found 6da6074d in https://inbox.vuxu.org/musl/20220503155655.11222-2-jmaselbas@kalray.eu/ ||
	https://inbox.vuxu.org/musl/20220504122426.11529-2-jmaselbas@kalray.eu/
found f3e8c407 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 f3e8c4077ec27c5eaf2f23bdf79f6f4491917eff	src/signal/sigset.c

applying [1/2] https://inbox.vuxu.org/musl/20220503155655.11222-2-jmaselbas@kalray.eu/
diff --git a/src/signal/sigset.c b/src/signal/sigset.c
index f3e8c407..6da6074d 100644

Checking patch src/signal/sigset.c...
Applied patch src/signal/sigset.c cleanly.

skipping https://inbox.vuxu.org/musl/20220504122426.11529-2-jmaselbas@kalray.eu/ for 6da6074d
index at:
100644 6da6074dc57a78fabfba48a702ad34b460c181f6	src/signal/sigset.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).