diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2011-05-15 08:09:02 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2011-05-15 08:09:02 +0000 |
commit | d81f6339ac6b1fe9435436fdb379a282e7e3deeb (patch) | |
tree | 41ea031ef1d55cf3a71a0226cef9988b7b5516da | |
parent | cb8dd24cdae494af7fae7697464118efe39c7474 (diff) |
use FD_CLOEXEC consistently; patch from zion AT x96.org
-rw-r--r-- | usr.bin/ssh/authfd.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/monitor.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/serverloop.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ssh/authfd.c b/usr.bin/ssh/authfd.c index 975777504cf..d0292995db8 100644 --- a/usr.bin/ssh/authfd.c +++ b/usr.bin/ssh/authfd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: authfd.c,v 1.84 2010/08/31 11:54:45 djm Exp $ */ +/* $OpenBSD: authfd.c,v 1.85 2011/05/15 08:09:01 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -108,7 +108,7 @@ ssh_get_authentication_socket(void) return -1; /* close on exec */ - if (fcntl(sock, F_SETFD, 1) == -1) { + if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1) { close(sock); return -1; } diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c index cb2ba89d6db..985bf28cf23 100644 --- a/usr.bin/ssh/monitor.c +++ b/usr.bin/ssh/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.110 2010/09/09 10:45:45 djm Exp $ */ +/* $OpenBSD: monitor.c,v 1.111 2011/05/15 08:09:01 djm Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * Copyright 2002 Markus Friedl <markus@openbsd.org> @@ -1513,7 +1513,7 @@ mm_init_compression(struct mm_master *mm) /* XXX */ #define FD_CLOSEONEXEC(x) do { \ - if (fcntl(x, F_SETFD, 1) == -1) \ + if (fcntl(x, F_SETFD, FD_CLOEXEC) == -1) \ fatal("fcntl(%d, F_SETFD)", x); \ } while (0) diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c index c118b60c2c6..f0299e55833 100644 --- a/usr.bin/ssh/serverloop.c +++ b/usr.bin/ssh/serverloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: serverloop.c,v 1.159 2009/05/28 16:50:16 andreas Exp $ */ +/* $OpenBSD: serverloop.c,v 1.160 2011/05/15 08:09:01 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -127,8 +127,8 @@ notify_setup(void) { if (pipe(notify_pipe) < 0) { error("pipe(notify_pipe) failed %s", strerror(errno)); - } else if ((fcntl(notify_pipe[0], F_SETFD, 1) == -1) || - (fcntl(notify_pipe[1], F_SETFD, 1) == -1)) { + } else if ((fcntl(notify_pipe[0], F_SETFD, FD_CLOEXEC) == -1) || + (fcntl(notify_pipe[1], F_SETFD, FD_CLOEXEC) == -1)) { error("fcntl(notify_pipe, F_SETFD) failed %s", strerror(errno)); close(notify_pipe[0]); close(notify_pipe[1]); |