diff options
author | ed <ed@FreeBSD.org> | 2016-05-30 13:51:27 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2016-05-30 13:51:27 +0000 |
commit | 68f1f316239562e4a08c9e54b851f916761a9b84 (patch) | |
tree | 1cdce214d42751df7acc477c7fd2485654996d05 /lib/libc | |
parent | 3e4cb7353ede7e585e56a1dec5a9b64630722844 (diff) | |
download | FreeBSD-src-68f1f316239562e4a08c9e54b851f916761a9b84.zip FreeBSD-src-68f1f316239562e4a08c9e54b851f916761a9b84.tar.gz |
Fix the signature of the psignal() function.
POSIX 2008 added the psignal() function which has already been part of
the BSDs for a long time. The only difference is, the POSIX version uses
an 'int' for the signal number, unlike our version which uses an
'unsigned int'. Fix up the function to use an 'int'. This should not
affect the ABI.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/psignal.3 | 4 | ||||
-rw-r--r-- | lib/libc/gen/psignal.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3 index 231acfa..ed7023b 100644 --- a/lib/libc/gen/psignal.3 +++ b/lib/libc/gen/psignal.3 @@ -28,7 +28,7 @@ .\" @(#)psignal.3 8.2 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd February 4, 2011 +.Dd May 30, 2016 .Dt PSIGNAL 3 .Os .Sh NAME @@ -42,7 +42,7 @@ .Sh SYNOPSIS .In signal.h .Ft void -.Fn psignal "unsigned sig" "const char *s" +.Fn psignal "int sig" "const char *s" .Vt extern const char * const sys_siglist[] ; .Vt extern const char * const sys_signame[] ; .In string.h diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c index 5c5aada..d1c70c6 100644 --- a/lib/libc/gen/psignal.c +++ b/lib/libc/gen/psignal.c @@ -44,11 +44,11 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" void -psignal(unsigned int sig, const char *s) +psignal(int sig, const char *s) { const char *c; - if (sig < NSIG) + if (sig >= 0 && sig < NSIG) c = sys_siglist[sig]; else c = "Unknown signal"; |