-/* $OpenBSD: server.c,v 1.118 2014/12/09 19:23:35 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.119 2015/04/21 22:32:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
size = strlcpy(sa.sun_path, socket_path, sizeof sa.sun_path);
if (size >= sizeof sa.sun_path) {
errno = ENAMETOOLONG;
- fatal("socket failed");
+ return (-1);
}
unlink(sa.sun_path);
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
- fatal("socket failed");
+ return (-1);
mask = umask(S_IXUSR|S_IXGRP|S_IRWXO);
if (bind(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == -1)
- fatal("bind failed");
+ return (-1);
umask(mask);
if (listen(fd, 16) == -1)
- fatal("listen failed");
+ return (-1);
setblocking(fd, 0);
- server_update_socket();
-
return (fd);
}
setproctitle("server (%s)", socket_path);
server_fd = server_create_socket();
+ if (server_fd == -1)
+ fatal("couldn't create socket");
+ server_update_socket();
server_client_create(pair[1]);
unlink(lockfile);
void
server_signal_callback(int sig, unused short events, unused void *data)
{
+ int fd;
switch (sig) {
case SIGTERM:
server_shutdown = 1;
break;
case SIGUSR1:
event_del(&server_ev_accept);
- close(server_fd);
- server_fd = server_create_socket();
+ fd = server_create_socket();
+ if (fd != -1) {
+ close(server_fd);
+ server_fd = fd;
+ server_update_socket();
+ }
server_add_accept(0);
break;
}
-.\" $OpenBSD: tmux.1,v 1.421 2015/04/20 15:34:56 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.422 2015/04/21 22:32:40 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 20 2015 $
+.Dd $Mdocdate: April 21 2015 $
.Dt TMUX 1
.Os
.Sh NAME
.Dv SIGUSR1
signal may be sent to the
.Nm
-server process to recreate it.
+server process to recreate it (note that this will fail if any parent
+directories are missing).
.It Fl l
Behave as a login shell.
This flag currently has no effect and is for compatibility with other shells
.Ar mode-table :
the binding for command mode with
.Fl c
-or for normal mode without. See the
+or for normal mode without.
+See the
.Sx WINDOWS AND PANES
section and the
.Ic list-keys