diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-11-19 10:38:06 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-11-19 10:38:06 +0000 |
commit | 827b311c8172f3543f9c38dc1d7740bba1d9aeaa (patch) | |
tree | dd900064b22c06b7f2d608d475288ae5000b0569 /server.c | |
parent | c68efec6c0f1a6ecf4950e4ddada4430fdea4156 (diff) | |
download | rtmux-827b311c8172f3543f9c38dc1d7740bba1d9aeaa.tar.gz rtmux-827b311c8172f3543f9c38dc1d7740bba1d9aeaa.tar.bz2 rtmux-827b311c8172f3543f9c38dc1d7740bba1d9aeaa.zip |
Use a utility function for common code to show errors in config file,
from Thomas Adam.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 21 |
1 files changed, 5 insertions, 16 deletions
@@ -106,11 +106,8 @@ server_create_socket(void) int server_start(int lockfd, char *lockfile) { - struct window_pane *wp; - int pair[2]; - char *cause; - struct timeval tv; - u_int i; + int pair[2]; + struct timeval tv; /* The first client is special and gets a socketpair; create it. */ if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0) @@ -178,17 +175,9 @@ server_start(int lockfd, char *lockfile) * If there is a session already, put the current window and pane into * more mode. */ - if (!RB_EMPTY(&sessions) && !ARRAY_EMPTY(&cfg_causes)) { - wp = RB_MIN(sessions, &sessions)->curw->window->active; - window_pane_set_mode(wp, &window_copy_mode); - window_copy_init_for_output(wp); - for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) { - cause = ARRAY_ITEM(&cfg_causes, i); - window_copy_add(wp, "%s", cause); - free(cause); - } - ARRAY_FREE(&cfg_causes); - } + if (!RB_EMPTY(&sessions) && !ARRAY_EMPTY(&cfg_causes)) + show_cfg_causes(RB_MIN(sessions, &sessions)); + cfg_finished = 1; server_add_accept(0); |