Quantcast
Channel: C Linux programming - Pipe makes child process exit - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Some programmer dude for C Linux programming - Pipe makes child process exit

$
0
0

That's standard behavior. You close the read-end of the pipe, so there is nowhere to write. That results in a SIGPIPE signal being sent to the writing process.

The default behavior of SIGPIPE is to terminate the process receiving the signal.

If you want your process to survive the signal, you have to catch or ignore it. Then you must check the result of write as it will return with an error when the pipes read-end is closed.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>