ctest: Set close-on-exec for jobserver FIFO
Set the close-on-exec flag to prevent the jobserver FIFO file descriptor from leaking to subprocesses spawned by `ctest`. This leak is usually harmless, but can cause `make test -jN` to hang at the end of the build if a test leaves a background process running with the jobserver FIFO file descriptor open. Fixes: #26027
This commit is contained in:
parent
efaa9efece
commit
ff077af032
@ -306,6 +306,10 @@ void ImplPosix::ConnectFIFO(const char* path)
|
||||
if (fd < 0) {
|
||||
return;
|
||||
}
|
||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
cm::uv_pipe_ptr connFIFO;
|
||||
connFIFO.init(this->Loop, 0, this);
|
||||
|
Loading…
Reference in New Issue
Block a user