-/* $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 <nicholas.marriott@gmail.com>
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);
}
-/* $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 <nicholas.marriott@gmail.com>
else {
TAILQ_FOREACH_SAFE(s, &sg->sessions, gentry, s1) {
server_destroy_session(s);
- session_destroy(s);
+ session_destroy(s, __func__);
}
}
}
if (!(s->flags & SESSION_UNATTACHED))
continue;
if (options_get_number (s->options, "destroy-unattached"))
- session_destroy(s);
+ session_destroy(s, __func__);
}
}
-/* $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 <nicholas.marriott@gmail.com>
}
RB_FOREACH_SAFE(s, sessions, &sessions, s1)
- session_destroy(s);
+ session_destroy(s, __func__);
}
/* Update socket execute permissions based on whether sessions are attached. */
{
int fd;
+ log_debug("%s: %s", __func__, strsignal(sig));
switch (sig) {
case SIGTERM:
server_exit = 1;
-/* $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 <nicholas.marriott@gmail.com>
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);
/* 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);
session_group_synchronize_from(s);
if (RB_EMPTY(&s->windows)) {
- session_destroy(s);
+ session_destroy(s, __func__);
return (1);
}
return (0);
-/* $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 <nicholas.marriott@gmail.com>
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 *);