=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.37 retrieving revision 1.37.2.1 diff -c -r1.37 -r1.37.2.1 *** src/usr.bin/tmux/server-client.c 2010/07/28 22:15:15 1.37 --- src/usr.bin/tmux/server-client.c 2010/10/02 03:06:00 1.37.2.1 *************** *** 1,4 **** ! /* $OpenBSD: server-client.c,v 1.37 2010/07/28 22:15:15 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-client.c,v 1.37.2.1 2010/10/02 03:06:00 william Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 648,664 **** fatalx("MSG_IDENTIFY missing fd"); memcpy(&identifydata, imsg.data, sizeof identifydata); ! c->stdin_fd = dup(imsg.fd); ! if (c->stdin_fd == -1) ! fatal("dup failed"); c->stdin_event = bufferevent_new(c->stdin_fd, NULL, NULL, server_client_in_callback, c); if (c->stdin_event == NULL) fatalx("failed to create stdin event"); ! if ((mode = fcntl(imsg.fd, F_GETFL)) != -1) ! fcntl(imsg.fd, F_SETFL, mode|O_NONBLOCK); ! if (fcntl(imsg.fd, F_SETFD, FD_CLOEXEC) == -1) fatal("fcntl failed"); server_client_msg_identify(c, &identifydata, imsg.fd); --- 648,662 ---- fatalx("MSG_IDENTIFY missing fd"); memcpy(&identifydata, imsg.data, sizeof identifydata); ! c->stdin_fd = imsg.fd; c->stdin_event = bufferevent_new(c->stdin_fd, NULL, NULL, server_client_in_callback, c); if (c->stdin_event == NULL) fatalx("failed to create stdin event"); ! if ((mode = fcntl(c->stdin_fd, F_GETFL)) != -1) ! fcntl(c->stdin_fd, F_SETFL, mode|O_NONBLOCK); ! if (fcntl(c->stdin_fd, F_SETFD, FD_CLOEXEC) == -1) fatal("fcntl failed"); server_client_msg_identify(c, &identifydata, imsg.fd);