You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have a few projects where I'm using Catch, and one or both of them require me to do some sort of operation that fork()'s the current process.
Needless to say, it's messy.
Since Catch is now running in two processes, two sets of output occur, which usually always results in one of them failing due to the child process getting signaled or something (especially if we try to exit()). The current fix is to close(1); to silence catch in the forked process, but that's not ideal.
What would be great is to see catch detect when it's being run inside of a fork and act accordingly - perhaps this means just silencing itself or not responding to signals. Or, better yet, format output accordingly.
Even better would be to have the parent process detect that it has forked and force the child process to open up a new file descriptor (FIFO or pipe or something) to write error messages to that the parent process can parse and use.
I know this would require a lot of work but by golly this would make Catch absolutely perfect. Even being able to detect if a forked process hasn't quit when we've reached the end of a SECTION() {} would be damn amazing.
Just a thought.
The text was updated successfully, but these errors were encountered:
So I have a few projects where I'm using Catch, and one or both of them require me to do some sort of operation that
fork()
's the current process.Needless to say, it's messy.
Since Catch is now running in two processes, two sets of output occur, which usually always results in one of them failing due to the child process getting signaled or something (especially if we try to
exit()
). The current fix is toclose(1);
to silence catch in the forked process, but that's not ideal.What would be great is to see catch detect when it's being run inside of a fork and act accordingly - perhaps this means just silencing itself or not responding to signals. Or, better yet, format output accordingly.
Even better would be to have the parent process detect that it has forked and force the child process to open up a new file descriptor (FIFO or pipe or something) to write error messages to that the parent process can parse and use.
I know this would require a lot of work but by golly this would make Catch absolutely perfect. Even being able to detect if a forked process hasn't quit when we've reached the end of a
SECTION() {}
would be damn amazing.Just a thought.
The text was updated successfully, but these errors were encountered: