5 Dec
2013
5 Dec
'13
4:25 p.m.
On Tue, Dec 03, 2013 at 08:18:28PM +0000, Mark Brown wrote:
On Tue, Dec 03, 2013 at 06:22:56PM +0000, Mark Brown wrote:
You can't safely do most of this such as calling fclose() from within a signal handler, the set of functions that are guaranteed safe is quite limited - see signal(7).
I should also have mentioned that it looks like you're probably looking for setvbuf() with _IONBF.
All good points, it is probably worth just merging the first patch in the series for now and I can have a more detailed look at the second patch.
Tricky thing is making 100% sure we don't enter a poll after we have received the signal, especially if we are just using the standard pattern of communicating the signal using a sig_atomic_t.
Thanks, Charles