mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
FD_CLOEXEC more fds. Still one I can't find...
This commit is contained in:
parent
d13add828a
commit
907bec675a
6
client.c
6
client.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: client.c,v 1.45 2009-03-27 17:04:04 nicm Exp $ */
|
/* $Id: client.c,v 1.46 2009-03-31 22:20:42 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -85,9 +85,9 @@ client_init(char *path, struct client_ctx *cctx, int start_server, int flags)
|
|||||||
|
|
||||||
server_started:
|
server_started:
|
||||||
if ((mode = fcntl(cctx->srv_fd, F_GETFL)) == -1)
|
if ((mode = fcntl(cctx->srv_fd, F_GETFL)) == -1)
|
||||||
fatal("fcntl");
|
fatal("fcntl failed");
|
||||||
if (fcntl(cctx->srv_fd, F_SETFL, mode|O_NONBLOCK) == -1)
|
if (fcntl(cctx->srv_fd, F_SETFL, mode|O_NONBLOCK) == -1)
|
||||||
fatal("fcntl");
|
fatal("fcntl failed");
|
||||||
cctx->srv_in = buffer_create(BUFSIZ);
|
cctx->srv_in = buffer_create(BUFSIZ);
|
||||||
cctx->srv_out = buffer_create(BUFSIZ);
|
cctx->srv_out = buffer_create(BUFSIZ);
|
||||||
|
|
||||||
|
4
server.c
4
server.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server.c,v 1.131 2009-03-28 15:49:05 nicm Exp $ */
|
/* $Id: server.c,v 1.132 2009-03-31 22:20:42 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -73,6 +73,8 @@ server_create_client(int fd)
|
|||||||
fatal("fcntl failed");
|
fatal("fcntl failed");
|
||||||
if (fcntl(fd, F_SETFL, mode|O_NONBLOCK) == -1)
|
if (fcntl(fd, F_SETFL, mode|O_NONBLOCK) == -1)
|
||||||
fatal("fcntl failed");
|
fatal("fcntl failed");
|
||||||
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
|
||||||
|
fatal("fcntl failed");
|
||||||
|
|
||||||
c = xcalloc(1, sizeof *c);
|
c = xcalloc(1, sizeof *c);
|
||||||
c->fd = fd;
|
c->fd = fd;
|
||||||
|
8
tty.c
8
tty.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tty.c,v 1.88 2009-03-31 18:39:45 nicm Exp $ */
|
/* $Id: tty.c,v 1.89 2009-03-31 22:20:42 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -98,9 +98,11 @@ tty_open(struct tty *tty, char **cause)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mode = fcntl(tty->fd, F_GETFL)) == -1)
|
if ((mode = fcntl(tty->fd, F_GETFL)) == -1)
|
||||||
fatal("fcntl");
|
fatal("fcntl failed");
|
||||||
if (fcntl(tty->fd, F_SETFL, mode|O_NONBLOCK) == -1)
|
if (fcntl(tty->fd, F_SETFL, mode|O_NONBLOCK) == -1)
|
||||||
fatal("fcntl");
|
fatal("fcntl failedo");
|
||||||
|
if (fcntl(tty->fd, F_SETFD, FD_CLOEXEC) == -1)
|
||||||
|
fatal("fcntl failed");
|
||||||
|
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
tty->log_fd = open("tmux.out", O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
tty->log_fd = open("tmux.out", O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
||||||
|
Loading…
Reference in New Issue
Block a user