diff options
-rw-r--r-- | usr/src/lib/brand/lx/lx_brand/common/ioctl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/ioctl.c b/usr/src/lib/brand/lx/lx_brand/common/ioctl.c index e4c3d95af4..a3b8f3b491 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/ioctl.c +++ b/usr/src/lib/brand/lx/lx_brand/common/ioctl.c @@ -558,6 +558,17 @@ lx_ioctl(uintptr_t p1, uintptr_t p2, uintptr_t p3) return (-errno); /* errno already set. */ } + /* Generic handling for FIOCLEX and FIONCLEX */ + if (cmd == LX_FIOCLEX) { + if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) + return (-errno); + return (0); + } else if (cmd == LX_FIONCLEX) { + if (fcntl(fd, F_SETFD, 0) == -1) + return (-errno); + return (0); + } + switch (stat.st_mode & S_IFMT) { default: break; |