From a62a5f614a98e388bef78cacb1e8152edf4fb203 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 16 Apr 2020 07:28:36 +0000 Subject: Show signal name when process exits rather than number. --- usr.bin/tmux/tmux.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'usr.bin/tmux/tmux.c') diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c index 2b57c7a35ab..52cadfbae66 100644 --- a/usr.bin/tmux/tmux.c +++ b/usr.bin/tmux/tmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.c,v 1.196 2020/04/09 15:35:27 nicm Exp $ */ +/* $OpenBSD: tmux.c,v 1.197 2020/04/16 07:28:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -167,6 +168,17 @@ setblocking(int fd, int state) } } +const char * +sig2name(int signo) +{ + static char s[11]; + + if (signo > 0 && signo < NSIG) + return (sys_signame[signo]); + xsnprintf(s, sizeof s, "%d", signo); + return (s); +} + const char * find_cwd(void) { -- cgit v1.2.3-59-g8ed1b