aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2016-05-30 13:51:27 +0000
committerEd Schouten <ed@FreeBSD.org>2016-05-30 13:51:27 +0000
commit0977bd1e889aae7c131863a72f37c71bfa0345d1 (patch)
tree1cdce214d42751df7acc477c7fd2485654996d05
parent07acf54b4bad4abba3192c032d28c863ca874bb2 (diff)
downloadsrc-0977bd1e889aae7c131863a72f37c71bfa0345d1.tar.gz
src-0977bd1e889aae7c131863a72f37c71bfa0345d1.zip
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.
Notes
Notes: svn path=/head/; revision=300997
-rw-r--r--include/signal.h2
-rw-r--r--lib/libc/gen/psignal.34
-rw-r--r--lib/libc/gen/psignal.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/include/signal.h b/include/signal.h
index 217faddea03d..9f33fb66d8c5 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -113,7 +113,7 @@ int siginterrupt(int, int);
#endif
#if __POSIX_VISIBLE >= 200809
-void psignal(unsigned int, const char *);
+void psignal(int, const char *);
#endif
#if __BSD_VISIBLE
diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3
index 231acfa5e107..ed7023b7a3f1 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 5c5aadae33ad..d1c70c600643 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";