|
From: | Paul Eggert |
Subject: | bug#23031: reporting write errors and handling SIGPIPE |
Date: | Wed, 16 Mar 2016 14:23:15 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 03/16/2016 09:14 AM, Assaf Gordon wrote:
write(1, "2\n", 2) = -1 EPIPE (Broken pipe)--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=2893, si_uid=1004} --- write(2, "./src/grep: ", 12) = 12
Although this looks weird and it's not what I would expect, it's not a POSIX violation as far as I can see. The system is required to send a SIGPIPE signal in this case, but it is not required to deliver the SIGPIPE signal before 'write' returns with errno == EPIPE. Arguably it's a bug in GNU/Linux anyway.
Your patch is a step in the right direction, but needs a bit of cleanup; I plan to look into it more carefully later. Thanks!
[Prev in Thread] | Current Thread | [Next in Thread] |