Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: implement uv_disable_stdio_inheritance()
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis authored and piscisaureus committed Jun 13, 2012
1 parent ade6930 commit 4d7f1e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/unix/core.c
Expand Up @@ -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;
}


Expand Down

0 comments on commit 4d7f1e1

Please sign in to comment.