I have a problem while executing a bash script from C++ using the system call command.
The script catches a SIGPIPE signal and exit with return code 141.
This problem has started to appear only in the last release of my code.
My Questions are as follows:
- Why does this SIGPIPE occur now and didn’t occur before?
- Is it safe to ignore the SIGPIPE and what are the consequences?
1) That’s very hard to answer without knowing exactly what you changed.
2) If a sequence of commands appears in a pipeline, and one of the reading commands finishes before the writer has finished, the writer receives a SIGPIPE signal. So whether you can ignore it depends on whether that is acceptable behavior for your script. More info here