From: nicm Date: Sun, 9 Jul 2017 22:33:09 +0000 (+0000) Subject: Some extra logging to show why tmux might exit. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bc4816c6f2d973029263e38215b2d0e62070b916;p=openbsd Some extra logging to show why tmux might exit. --- diff --git a/usr.bin/tmux/cmd-kill-session.c b/usr.bin/tmux/cmd-kill-session.c index 47673625fda..9dbf7fe992e 100644 --- a/usr.bin/tmux/cmd-kill-session.c +++ b/usr.bin/tmux/cmd-kill-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-kill-session.c,v 1.23 2017/04/22 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-kill-session.c,v 1.24 2017/07/09 22:33:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -61,12 +61,12 @@ cmd_kill_session_exec(struct cmd *self, struct cmdq_item *item) RB_FOREACH_SAFE(sloop, sessions, &sessions, stmp) { if (sloop != s) { server_destroy_session(sloop); - session_destroy(sloop); + session_destroy(sloop, __func__); } } } else { server_destroy_session(s); - session_destroy(s); + session_destroy(s, __func__); } return (CMD_RETURN_NORMAL); } diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index 19517535090..aa707ecb7c2 100644 --- a/usr.bin/tmux/server-fn.c +++ b/usr.bin/tmux/server-fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.108 2017/05/12 13:00:56 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.109 2017/07/09 22:33:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -333,7 +333,7 @@ server_destroy_session_group(struct session *s) else { TAILQ_FOREACH_SAFE(s, &sg->sessions, gentry, s1) { server_destroy_session(s); - session_destroy(s); + session_destroy(s, __func__); } } } @@ -399,7 +399,7 @@ server_check_unattached(void) if (!(s->flags & SESSION_UNATTACHED)) continue; if (options_get_number (s->options, "destroy-unattached")) - session_destroy(s); + session_destroy(s, __func__); } } diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index 29a2abede8f..1b73f315c1f 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.172 2017/07/03 08:16:03 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.173 2017/07/09 22:33:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -249,7 +249,7 @@ server_send_exit(void) } RB_FOREACH_SAFE(s, sessions, &sessions, s1) - session_destroy(s); + session_destroy(s, __func__); } /* Update socket execute permissions based on whether sessions are attached. */ @@ -347,6 +347,7 @@ server_signal(int sig) { int fd; + log_debug("%s: %s", __func__, strsignal(sig)); switch (sig) { case SIGTERM: server_exit = 1; diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c index eb0aae4a6df..c45b71cac47 100644 --- a/usr.bin/tmux/session.c +++ b/usr.bin/tmux/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.76 2017/05/04 07:16:43 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.77 2017/07/09 22:33:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -178,7 +178,7 @@ session_create(const char *prefix, const char *name, int argc, char **argv, if (argc >= 0) { wl = session_new(s, NULL, argc, argv, path, cwd, idx, cause); if (wl == NULL) { - session_destroy(s); + session_destroy(s, __func__); return (NULL); } session_select(s, RB_ROOT(&s->windows)->idx); @@ -229,11 +229,11 @@ session_free(__unused int fd, __unused short events, void *arg) /* Destroy a session. */ void -session_destroy(struct session *s) +session_destroy(struct session *s, const char *from) { struct winlink *wl; - log_debug("session %s destroyed", s->name); + log_debug("session %s destroyed (%s)", s->name, from); s->curw = NULL; RB_REMOVE(sessions, &sessions, s); @@ -419,7 +419,7 @@ session_detach(struct session *s, struct winlink *wl) session_group_synchronize_from(s); if (RB_EMPTY(&s->windows)) { - session_destroy(s); + session_destroy(s, __func__); return (1); } return (0); diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 53366098eef..41dfb9e1a6b 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.791 2017/07/03 12:38:50 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.792 2017/07/09 22:33:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -2295,7 +2295,7 @@ struct session *session_find_by_id(u_int); struct session *session_create(const char *, const char *, int, char **, const char *, const char *, struct environ *, struct termios *, int, u_int, u_int, char **); -void session_destroy(struct session *); +void session_destroy(struct session *, const char *); void session_add_ref(struct session *, const char *); void session_remove_ref(struct session *, const char *); int session_check_name(const char *);