mailing list of musl libc
 help / color / mirror / code / Atom feed
85f64ec644203decaa6c6e5f95cc69cecd562dfd blob 1654 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
#include <signal.h>
#include <stdio.h>
#include <string.h>

int sig2str(int signum, char *str)
{
	const char *name = NULL;
	switch(signum)
	{
		case SIGHUP: name = "HUP"; break;
		case SIGINT: name = "INT"; break;
		case SIGQUIT: name = "QUIT"; break;
		case SIGILL: name = "ILL"; break;
		case SIGTRAP: name = "TRAP"; break;
		case SIGABRT: name = "ABRT"; break;
		case SIGBUS: name = "BUS"; break;
		case SIGFPE: name = "FPE"; break;
		case SIGKILL: name = "KILL"; break;
		case SIGUSR1: name = "USR1"; break;
		case SIGSEGV: name = "SEGV"; break;
		case SIGUSR2: name = "USR2"; break;
		case SIGPIPE: name = "PIPE"; break;
		case SIGALRM: name = "ALRM"; break;
		case SIGTERM: name = "TERM"; break;
		case SIGSTKFLT: name = "STKFLT"; break;
		case SIGCHLD: name = "CHLD"; break;
		case SIGCONT: name = "CONT"; break;
		case SIGSTOP: name = "STOP"; break;
		case SIGTSTP: name = "TSTP"; break;
		case SIGTTIN: name = "TTIN"; break;
		case SIGTTOU: name = "TTOU"; break;
		case SIGURG: name = "URG"; break;
		case SIGXCPU: name = "XCPU"; break;
		case SIGXFSZ: name = "XFSZ"; break;
		case SIGVTALRM: name = "VTALRM"; break;
		case SIGPROF: name = "PROF"; break;
		case SIGWINCH: name = "WINCH"; break;
		case SIGIO: name = "IO"; break;
		case SIGPWR: name = "PWR"; break;
		case SIGSYS: name = "SYS"; break;
	}

	// macros to functions can't be in switch-case
	if(signum == SIGRTMIN) name = "RTMIN";
	if(signum == SIGRTMAX) name = "RTMAX";

	if(SIGRTMIN+1 <= signum && signum <= SIGRTMAX-1)
	{
		if(snprintf(str, SIG2STR_MAX, "RTMIN+%i", signum-SIGRTMIN) < 0) return -1;

		return 0;
	}

	if(name == NULL) return -1;

	strcpy(str, name);

	return 0;
}
debug log:

solving 85f64ec6 ...
found 85f64ec6 in https://inbox.vuxu.org/musl/20240804124145.30659-1-contact@hacktivis.me/

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

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

index at:
100644 85f64ec644203decaa6c6e5f95cc69cecd562dfd	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).