summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/syscall/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/syscall/open.c')
-rw-r--r--usr/src/uts/common/syscall/open.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/usr/src/uts/common/syscall/open.c b/usr/src/uts/common/syscall/open.c
index 6559900158..edb04c824b 100644
--- a/usr/src/uts/common/syscall/open.c
+++ b/usr/src/uts/common/syscall/open.c
@@ -27,6 +27,9 @@
/* All Rights Reserved */
/*
+ * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
+ */
+/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
@@ -226,6 +229,9 @@ noxattr:
* falloc reserved.
*/
setf(fd, fp);
+ if ((filemode & FCLOEXEC) != 0) {
+ f_setfd(fd, FD_CLOEXEC);
+ }
return (fd);
} else {
/*
@@ -252,6 +258,9 @@ noxattr:
fp->f_count++;
mutex_exit(&fp->f_tlock);
setf(fd, fp);
+ if ((filemode & FCLOEXEC) != 0) {
+ f_setfd(fd, FD_CLOEXEC);
+ }
releasef(dupfd);
}
return (fd);