I have created a fifo using C and python programs. The fifo is created in the C program, which does the reading Operation and the writing is done in Python. My question is as follows:

If my reader(C program) is killed forcefully, my writer keeps writing to the fifo. How can I handle this so that the writer exits when reader is killed?
When the reader is killed , is a SIGPIPE signal recieved by the writer?
So I observed the following on further testing:

When the reader process is killed, SIGPIPE is not recieved by the writer.
However, when reader is killed, the open call for the fifo file is blocked at the writer's end.
So, I have currently resolved the issue in question no.1 by adding O_NONBLOCK flag in my writer's open call. Once this is added, open call throws an exception if the fifo has no active readers.
Thanks!
Is SIGPIPE signal received when reader is killed forcefully(kill -9)?