summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-11-11 08:00:43 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-11-11 08:00:43 +0000
commite9562d24870837453ece1ae7898fdf93f9ac66ab (patch)
treea27c3c61a02d4b0715e2da831b961ba3ab2febeb /usr.bin/tmux/server.c
parentbfb0f4fec84a72e97be1b73db2c40202e07808b6 (diff)
Only need to chmod +x or -x the socket when a client is created, lost or
attached, rather than every event loop.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 05515db4248..fbdb2f25754 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.74 2009/11/05 08:50:32 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.75 2009/11/11 08:00:42 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -59,7 +59,6 @@ void server_loop(void);
int server_should_shutdown(void);
void server_send_shutdown(void);
void server_clean_dead(void);
-int server_update_socket(void);
void server_accept_callback(int, short, void *);
void server_signal_callback(int, short, void *);
void server_child_signal(void);
@@ -105,6 +104,8 @@ server_create_socket(void)
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
fatal("fcntl failed");
+ server_update_socket();
+
return (fd);
}
@@ -208,8 +209,6 @@ void
server_loop(void)
{
while (!server_should_shutdown()) {
- server_update_socket();
-
event_loop(EVLOOP_ONCE);
server_window_loop();
@@ -288,7 +287,7 @@ server_clean_dead(void)
}
/* Update socket execute permissions based on whether sessions are attached. */
-int
+void
server_update_socket(void)
{
struct session *s;
@@ -312,8 +311,6 @@ server_update_socket(void)
else
chmod(socket_path, S_IRUSR|S_IWUSR);
}
-
- return (n);
}
/* Callback for server socket. */