diff options
Diffstat (limited to 'lib/libproc/proc_util.c')
-rw-r--r-- | lib/libproc/proc_util.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libproc/proc_util.c b/lib/libproc/proc_util.c index 9af627422ef8..a062b9a1f461 100644 --- a/lib/libproc/proc_util.c +++ b/lib/libproc/proc_util.c @@ -30,7 +30,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> #include <sys/types.h> #include <sys/ptrace.h> #include <sys/wait.h> @@ -38,6 +37,7 @@ #include <err.h> #include <errno.h> #include <signal.h> +#include <stdio.h> #include <string.h> #include <unistd.h> @@ -181,8 +181,12 @@ proc_getwstat(struct proc_handle *phdl) char * proc_signame(int sig, char *name, size_t namesz) { + char buf[SIG2STR_MAX]; - strlcpy(name, strsignal(sig), namesz); + if (sig2str(sig, buf) == 0) + (void)snprintf(name, namesz, "SIG%s", buf); + else + (void)snprintf(name, namesz, "SIG#%d", sig); return (name); } |