Merge branch 'obsd-master'

Conflicts:
	cfg.c
	tmux.c
This commit is contained in:
Thomas Adam
2015-09-06 20:47:50 +01:00
17 changed files with 346 additions and 374 deletions

View File

@ -157,10 +157,9 @@ server_create_socket(void)
/* Fork new server. */
int
server_start(int lockfd, char *lockfile)
server_start(struct event_base *base, int lockfd, char *lockfile)
{
int pair[2];
char *cause;
int pair[2];
/* The first client is special and gets a socketpair; create it. */
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0)
@ -187,7 +186,7 @@ server_start(int lockfd, char *lockfile)
/* event_init() was called in our parent, need to reinit. */
clear_signals(0);
if (event_reinit(ev_base) != 0)
if (event_reinit(base) != 0)
fatal("event_reinit failed");
logfile("server");
@ -218,24 +217,8 @@ server_start(int lockfd, char *lockfile)
free(lockfile);
close(lockfd);
cfg_cmd_q = cmdq_new(NULL);
cfg_cmd_q->emptyfn = cfg_default_done;
cfg_finished = 0;
cfg_references = 1;
cfg_client = TAILQ_FIRST(&clients);
if (cfg_client != NULL)
cfg_client->references++;
start_cfg();
if (access(TMUX_CONF, R_OK) == 0) {
if (load_cfg(TMUX_CONF, cfg_cmd_q, &cause) == -1)
cfg_add_cause("%s: %s", TMUX_CONF, cause);
} else if (errno != ENOENT)
cfg_add_cause("%s: %s", TMUX_CONF, strerror(errno));
if (cfg_file != NULL) {
if (load_cfg(cfg_file, cfg_cmd_q, &cause) == -1)
cfg_add_cause("%s: %s", cfg_file, cause);
}
cmdq_continue(cfg_cmd_q);
status_prompt_load_history();
server_add_accept(0);