]>
Commit | Line | Data |
---|---|---|
2ccf2eb2 | 1 | /* |
37be9888 AJ |
2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
3 | * | |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
2ccf2eb2 | 7 | */ |
37be9888 | 8 | |
f7f3304a | 9 | #include "squid.h" |
2ccf2eb2 AJ |
10 | #include "psignal.h" |
11 | ||
6b7b32cd | 12 | #if _SQUID_AIX_ || _SQUID_ANDROID_ || _SQUID_MINGW_ |
2ccf2eb2 AJ |
13 | extern const char* const sys_siglist[]; |
14 | #define _sys_nsig 64 | |
15 | #define _sys_siglist sys_siglist | |
16 | #endif | |
17 | ||
18 | /// purpose: print message, colon, space, signal name and LF. | |
19 | /// paramtr: sig (IN): signal number | |
20 | /// msg (IN): message to prepend | |
21 | void | |
22 | psignal( int sig, const char* msg ) | |
23 | { | |
24 | if ( msg && *msg ) fprintf( stderr, "%s: ", msg ); | |
25 | if ( sig > 0 && sig < _sys_nsig ) | |
26 | fprintf( stderr, "%s\n", _sys_siglist[sig] ); | |
27 | else | |
28 | fputs( "(unknown)\n", stderr ); | |
29 | } |