Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

unix: implement uv_disable_stdio_inheritance()

  • Loading branch information...
bnoordhuis authored and piscisaureus committed Jun 13, 2012
1 parent ade6930 commit 4d7f1e1864983c9ffc76a52af3346777806767ee
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/unix/core.c
@@ -587,6 +587,14 @@ uv_err_t uv_chdir(const char* dir) {


void uv_disable_stdio_inheritance(void) {
int fd;

/* Set the CLOEXEC flag on all open descriptors. Unconditionally try the
* first 16 file descriptors. After that, bail out after the first error.
*/
for (fd = 0; ; fd++)
if (uv__cloexec(fd, 1) && fd > 15)
break;
}


0 comments on commit 4d7f1e1

Please sign in to comment.
You can’t perform that action at this time.