summaryrefslogtreecommitdiffstats
path: root/lib/libutil/pty.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2016-08-30 14:44:45 +0000
committerguenther <guenther@openbsd.org>2016-08-30 14:44:45 +0000
commit478ad52bba6ed7f0eb423b292954c9e49b312fd9 (patch)
tree0dc470f0e0857536301fc906251a8270c9fe1d7e /lib/libutil/pty.c
parentAdd OPTION_ARG_TIME for parsing a (64 bit if needed) time_t (diff)
downloadwireguard-openbsd-478ad52bba6ed7f0eb423b292954c9e49b312fd9.tar.xz
wireguard-openbsd-478ad52bba6ed7f0eb423b292954c9e49b312fd9.zip
Use O_CLOEXEC when opening fds local to a function
ok jca@ krw@
Diffstat (limited to 'lib/libutil/pty.c')
-rw-r--r--lib/libutil/pty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c
index 598b8fa1405..2a19de81ca5 100644
--- a/lib/libutil/pty.c
+++ b/lib/libutil/pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pty.c,v 1.19 2013/05/21 19:07:02 matthew Exp $ */
+/* $OpenBSD: pty.c,v 1.20 2016/08/30 14:44:45 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -54,7 +54,7 @@ openpty(int *amaster, int *aslave, char *name, struct termios *termp,
* Use /dev/ptm and the PTMGET ioctl to get a properly set up and
* owned pty/tty pair.
*/
- fd = open(PATH_PTMDEV, O_RDWR, 0);
+ fd = open(PATH_PTMDEV, O_RDWR|O_CLOEXEC);
if (fd == -1)
return (-1);
if ((ioctl(fd, PTMGET, &ptm) == -1)) {