xref: /haiku/src/system/libroot/posix/signal/psignal.cpp (revision f2b4344867e97c3f4e742a1b4a15e6879644601a)
1 /*
2  * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <signal.h>
8 
9 #include <stdio.h>
10 #include <string.h>
11 
12 
13 void
14 psignal(int signal, const char* message)
15 {
16 	if (message != NULL && message[0] != '\0')
17 		fprintf(stderr, "%s: %s\n", message, strsignal(signal));
18 	else
19 		fprintf(stderr, "%s\n", strsignal(signal));
20 }
21