Skip to content

Commit

Permalink
Merge pull request #2326 from kyllingstad/no-setcloexec-fail
Browse files Browse the repository at this point in the history
Fix issue #13100 - std.process.setCLOEXEC() throws on invalid file descriptor
  • Loading branch information
Михаил Страшун committed Jul 12, 2014
2 parents 911ea31 + b7af42b commit 357b627
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions std/process.d
Expand Up @@ -719,11 +719,7 @@ private void setCLOEXEC(int fd, bool on)
else flags &= ~(cast(typeof(flags)) FD_CLOEXEC);
flags = fcntl(fd, F_SETFD, flags);
}
if (flags == -1)
{
throw new StdioException("Failed to "~(on ? "" : "un")
~"set close-on-exec flag on file descriptor");
}
assert (flags != -1 || .errno == EBADF);
}

unittest // Command line arguments in spawnProcess().
Expand Down

0 comments on commit 357b627

Please sign in to comment.