Update of /cvsroot/tmux/tmux
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10514
Modified Files:
server-client.c
Log Message:
Sync OpenBSD patchset 750:
Do not need to dup() the tty fd sent from the client because it is
already dup()d again later. Fixes a leak seen by es...@.
Index: server-client.c
===================================================================
RCS file: /cvsroot/tmux/tmux/server-client.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- server-client.c 11 Aug 2010 22:16:03 -0000 1.39
+++ server-client.c 29 Aug 2010 14:39:45 -0000 1.40
@@ -695,17 +695,15 @@
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_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(imsg.fd, F_GETFL)) != -1)
- fcntl(imsg.fd, F_SETFL, mode|O_NONBLOCK);
- if (fcntl(imsg.fd, F_SETFD, FD_CLOEXEC) == -1)
+ 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);
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs