summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/server.c3
-rw-r--r--usr.bin/tmux/session.c12
-rw-r--r--usr.bin/tmux/tmux.h5
3 files changed, 7 insertions, 13 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index c3c39c31399..679bae889ef 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.180 2018/03/08 08:09:10 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.181 2018/08/02 11:56:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -202,7 +202,6 @@ server_start(struct tmuxproc *client, struct event_base *base, int lockfd,
RB_INIT(&all_window_panes);
TAILQ_INIT(&clients);
RB_INIT(&sessions);
- RB_INIT(&session_groups);
key_bindings_init();
gettimeofday(&start_time, NULL);
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c
index e499d7b5a53..69cc0dbad75 100644
--- a/usr.bin/tmux/session.c
+++ b/usr.bin/tmux/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.79 2018/05/04 08:21:42 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.80 2018/08/02 11:56:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -29,7 +29,7 @@
struct sessions sessions;
static u_int next_session_id;
-struct session_groups session_groups;
+struct session_groups session_groups = RB_INITIALIZER(&session_groups);
static void session_free(int, short, void *);
@@ -41,21 +41,19 @@ static struct winlink *session_previous_alert(struct winlink *);
static void session_group_remove(struct session *);
static void session_group_synchronize1(struct session *, struct session *);
-RB_GENERATE(sessions, session, entry, session_cmp);
-
int
session_cmp(struct session *s1, struct session *s2)
{
return (strcmp(s1->name, s2->name));
}
+RB_GENERATE(sessions, session, entry, session_cmp);
-RB_GENERATE(session_groups, session_group, entry, session_group_cmp);
-
-int
+static int
session_group_cmp(struct session_group *s1, struct session_group *s2)
{
return (strcmp(s1->name, s2->name));
}
+RB_GENERATE_STATIC(session_groups, session_group, entry, session_group_cmp);
/*
* Find if session is still alive. This is true if it is still on the global
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 5f5e93009d9..145125576c0 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.834 2018/08/02 11:44:07 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.835 2018/08/02 11:56:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2281,11 +2281,8 @@ void control_notify_session_window_changed(struct session *);
/* session.c */
extern struct sessions sessions;
-extern struct session_groups session_groups;
int session_cmp(struct session *, struct session *);
RB_PROTOTYPE(sessions, session, entry, session_cmp);
-int session_group_cmp(struct session_group *, struct session_group *);
-RB_PROTOTYPE(session_groups, session_group, entry, session_group_cmp);
int session_alive(struct session *);
struct session *session_find(const char *);
struct session *session_find_by_id_str(const char *);