version 1.105, 2012/07/10 11:53:01 |
version 1.106, 2012/11/19 10:38:06 |
|
|
int |
int |
server_start(int lockfd, char *lockfile) |
server_start(int lockfd, char *lockfile) |
{ |
{ |
struct window_pane *wp; |
int pair[2]; |
int pair[2]; |
struct timeval tv; |
char *cause; |
|
struct timeval tv; |
|
u_int i; |
|
|
|
/* The first client is special and gets a socketpair; create it. */ |
/* The first client is special and gets a socketpair; create it. */ |
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0) |
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0) |
|
|
* If there is a session already, put the current window and pane into |
* If there is a session already, put the current window and pane into |
* more mode. |
* more mode. |
*/ |
*/ |
if (!RB_EMPTY(&sessions) && !ARRAY_EMPTY(&cfg_causes)) { |
if (!RB_EMPTY(&sessions) && !ARRAY_EMPTY(&cfg_causes)) |
wp = RB_MIN(sessions, &sessions)->curw->window->active; |
show_cfg_causes(RB_MIN(sessions, &sessions)); |
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); |
|
} |
|
cfg_finished = 1; |
cfg_finished = 1; |
|
|
server_add_accept(0); |
server_add_accept(0); |