summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libsndio/aucat.c6
-rw-r--r--lib/libsndio/sun.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index 7acef2189a2..7936a8319e4 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.12 2009/02/03 19:44:58 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.13 2009/02/04 07:54:00 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -103,6 +103,10 @@ sio_open_aucat(char *path, unsigned mode, int nbio)
continue;
goto bad_connect;
}
+ if (fcntl(s, F_SETFD, FD_CLOEXEC) < 0) {
+ DPERROR(&hdl->sa, "FD_CLOEXEC");
+ goto bad_connect;
+ }
hdl->fd = s;
hdl->rstate = STATE_IDLE;
hdl->rtodo = 0xdeadbeef;
diff --git a/lib/libsndio/sun.c b/lib/libsndio/sun.c
index b36c4abfe1b..518f708a3e5 100644
--- a/lib/libsndio/sun.c
+++ b/lib/libsndio/sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sun.c,v 1.12 2009/01/10 20:34:44 ratchov Exp $ */
+/* $OpenBSD: sun.c,v 1.13 2009/02/04 07:54:00 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -365,6 +365,10 @@ sio_open_sun(char *path, unsigned mode, int nbio)
DPERROR(&hdl->sa, path);
goto bad_free;
}
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
+ DPERROR(&hdl->sa, "FD_CLOEXEC");
+ goto bad_close;
+ }
hdl->fd = fd;
/*