[Rpm-maint] Sigpipe handling in build/rpmfc.c

2011-06-06 Thread Michael Schroeder
Hi guys, what's the reason for the complex pipe handling with sigpipe_handler(), sigpipe_init() and sigpipe_finish()? IMHO aborting the read when a SIGCHLD occurs is wrong, as the pipe may still contain unread data (and data is only read in sizeof(buf)-1 chunks). Wouldn't it make more sense to s

Re: [Rpm-maint] Sigpipe handling in build/rpmfc.c

2011-06-06 Thread Panu Matilainen
On 06/06/2011 02:40 PM, Michael Schroeder wrote: Hi guys, what's the reason for the complex pipe handling with sigpipe_handler(), sigpipe_init() and sigpipe_finish()? The point was to make it more robust: a) use blocking io instead of spinning on a timeout that will inevitably be wrong for s

Re: [Rpm-maint] Sigpipe handling in build/rpmfc.c

2011-06-07 Thread Michael Schroeder
On Tue, Jun 07, 2011 at 09:35:38AM +0300, Panu Matilainen wrote: > >IMHO aborting the read when a SIGCHLD occurs is wrong, as the > >pipe may still contain unread data (and data is only read in > >sizeof(buf)-1 chunks). Wouldn't it make more sense to simply > >ignore SIGCHLD and read until an EOF i

Re: [Rpm-maint] Sigpipe handling in build/rpmfc.c

2011-06-07 Thread Panu Matilainen
On 06/07/2011 10:14 AM, Michael Schroeder wrote: On Tue, Jun 07, 2011 at 09:35:38AM +0300, Panu Matilainen wrote: IMHO aborting the read when a SIGCHLD occurs is wrong, as the pipe may still contain unread data (and data is only read in sizeof(buf)-1 chunks). Wouldn't it make more sense to simpl