Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2020-04-16 10:01:33 +01:00
commit dd66ede38b
3 changed files with 15 additions and 2 deletions

View File

@ -335,8 +335,8 @@ server_destroy_pane(struct window_pane *wp, int notify)
tim);
} else if (WIFSIGNALED(wp->status)) {
screen_write_nputs(&ctx, -1, &gc,
"Pane is dead (signal %d, %s)",
WTERMSIG(wp->status),
"Pane is dead (signal %s, %s)",
sig2name(WTERMSIG(wp->status)),
tim);
}

12
tmux.c
View File

@ -26,6 +26,7 @@
#include <langinfo.h>
#include <locale.h>
#include <pwd.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@ -164,6 +165,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)
{

1
tmux.h
View File

@ -1727,6 +1727,7 @@ extern int ptm_fd;
extern const char *shell_command;
int checkshell(const char *);
void setblocking(int, int);
const char *sig2name(int);
const char *find_cwd(void);
const char *find_home(void);
const char *getversion(void);