Set up signal handler earlier so that we don't get zombies, reported by
authornicm <nicm@openbsd.org>
Fri, 24 Apr 2015 20:58:44 +0000 (20:58 +0000)
committernicm <nicm@openbsd.org>
Fri, 24 Apr 2015 20:58:44 +0000 (20:58 +0000)
sobrado@.

usr.bin/tmux/client.c

index 9dfd20d..744a6fe 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.87 2015/04/21 22:21:41 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.88 2015/04/24 20:58:44 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -262,6 +262,9 @@ client_main(int argc, char **argv, int flags)
        setproctitle("client (%s)", socket_path);
        logfile("client");
 
+       /* Establish signal handlers. */
+       set_signals(client_signal);
+
        /* Initialize the client socket and start the server. */
        fd = client_connect(socket_path, cmdflags & CMD_STARTSERVER);
        if (fd == -1) {
@@ -301,9 +304,6 @@ client_main(int argc, char **argv, int flags)
                tcsetattr(STDIN_FILENO, TCSANOW, &tio);
        }
 
-       /* Establish signal handlers. */
-       set_signals(client_signal);
-
        /* Send identify messages. */
        client_send_identify(flags);