mailing list of musl libc
 help / color / mirror / code / Atom feed
989d36458bf638dd5d01be949f54eba251c093d0 blob 536 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
28
29
30
31
32
33
34
 
#include <signal.h>
#include <string.h>

int sig2str(int sig, char *str)
{
	if (sig <= 0) return -1;

	if (sig <= SIGSYS)
		return (strcpy(str, __sys_signame[sig]), 0);

	if (sig == SIGRTMIN)
		return (strcpy(str, "RTMIN"), 0);
	if (sig == SIGRTMAX)
		return (strcpy(str, "RTMAX"), 0);

	if (sig > SIGRTMIN && sig <= SIGRTMAX)
	{
		strcpy(str, "RTMIN+");
		int sigrt = sig-SIGRTMIN;

		char *s = str+6;
		if (sigrt>=10)
		{
			*s++ = '0' + sigrt/10;
			sigrt %= 10;
		}
		*s++ = '0' + sigrt;
		*s = '\0';

		return 0;
	}

	return -1;
}
debug log:

solving 989d3645 ...
found 989d3645 in https://inbox.vuxu.org/musl/20240809153423.30829-2-contact@hacktivis.me/

applying [1/1] https://inbox.vuxu.org/musl/20240809153423.30829-2-contact@hacktivis.me/
diff --git a/src/signal/sig2str.c b/src/signal/sig2str.c
new file mode 100644
index 00000000..989d3645

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

index at:
100644 989d36458bf638dd5d01be949f54eba251c093d0	src/signal/sig2str.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).