add FD_CLOEXEC to --exec: needed for multiple uses of --exec
without FD_CLOEXEC the second forked/executed process will hold copy of the input FD of the first sub-process
which will be waiting for input messages (hang)
--- a/src/SubProcess.cpp Sat Jan 11 00:56:51 2020 +0100
+++ b/src/SubProcess.cpp Sat Jan 11 00:58:35 2020 +0100
@@ -142,6 +142,8 @@
// Parent process
closeOrThrow(subInputReaderFD);
closeOrThrow(subOutputWriterFD);
+ fcntl(subInputWriterFD, F_SETFD, FD_CLOEXEC);
+ fcntl(subOutputReaderFD, F_SETFD, FD_CLOEXEC);
return new SubProcessImpl(subPid, subInputWriterFD, subOutputReaderFD);
}
}