aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-03-31 22:20:42 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-03-31 22:20:42 +0000
commit907bec675a640d733f380ade2131ac05cb8eed48 (patch)
treed8ed805779c713361c437e121a5943e728b97c42 /tty.c
parentd13add828ad7737dea34384e7fc0bf116ffff605 (diff)
downloadrtmux-907bec675a640d733f380ade2131ac05cb8eed48.tar.gz
rtmux-907bec675a640d733f380ade2131ac05cb8eed48.tar.bz2
rtmux-907bec675a640d733f380ade2131ac05cb8eed48.zip
FD_CLOEXEC more fds. Still one I can't find...
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tty.c b/tty.c
index 000ac55e..09db0516 100644
--- a/tty.c
+++ b/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>
@@ -98,9 +98,11 @@ tty_open(struct tty *tty, char **cause)
}
if ((mode = fcntl(tty->fd, F_GETFL)) == -1)
- fatal("fcntl");
+ fatal("fcntl failed");
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)
tty->log_fd = open("tmux.out", O_WRONLY|O_CREAT|O_TRUNC, 0644);