Sync OpenBSD patchset 777:

Merge the before and after attach client code into one in client.c
(instead of two in tmux.c and client.c).
This commit is contained in:
Tiago Cunha
2010-10-24 01:31:08 +00:00
parent 1276ea3653
commit bdbd4e28c2
4 changed files with 300 additions and 349 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: server.c,v 1.246 2010-10-24 00:45:57 tcunha Exp $ */
/* $Id: server.c,v 1.247 2010-10-24 01:31:08 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -105,16 +105,13 @@ server_create_socket(void)
/* Fork new server. */
int
server_start(char *path)
server_start(void)
{
struct window_pane *wp;
int pair[2];
char *cause;
struct timeval tv;
u_int i;
#ifdef HAVE_SETPROCTITLE
char rpathbuf[MAXPATHLEN];
#endif
/* The first client is special and gets a socketpair; create it. */
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0)
@@ -157,14 +154,8 @@ server_start(char *path)
utf8_build();
start_time = time(NULL);
socket_path = path;
#ifdef HAVE_SETPROCTITLE
if (realpath(socket_path, rpathbuf) == NULL)
strlcpy(rpathbuf, socket_path, sizeof rpathbuf);
log_debug("socket path %s", socket_path);
setproctitle("server (%s)", rpathbuf);
#endif
setproctitle("server (%s)", socket_path);
server_fd = server_create_socket();
server_client_create(pair[1]);