bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] exit status problem with pipe


From: Peng Yu
Subject: Re: [Bug-wget] exit status problem with pipe
Date: Mon, 22 Oct 2018 15:30:18 -0500

Can wget at least allow 141 for pipes but not sockets? Many GNU tools
(such coreutiles) uses 141 for pipe signals. I'd like other programs
to follow the same convention so that I can use the exit_status for
error checking.

On 10/22/18, Darshit Shah <address@hidden> wrote:
> This is difficult to do correctly for network applications. Is there any
> particular reason you're looking for identifying if Wget was killed by
> SIGPIPE?
>
> The problem here is that a closed socket will also result in a SIGPIPE on
> unix
> systems. But in such a case, we don't want to kill the application. As a
> result, we simply ignore the SIGPIPE handler. So when Wget dies in the
> command
> you shared, its not really killed by SIGPIPE. Hence, in theory, it would be
> incorrect for Wget to exit with a code of 141.
>
> * Peng Yu <address@hidden> [181022 16:29]:
>> Hi,
>>
>> wget returns the following exit code when it is dealing with pipe. But
>> it does not follow the common practice. Should this behavior be fixed?
>>
>> $ wget -qO- http://httpbin.org/get | echo
>>
>> $ echo address@hidden
>> 3 0
>> $ seq 10 | echo
>>
>> $ echo address@hidden
>> 141 0
>>
>> --
>> Regards,
>> Peng
>>
>>
>
> --
> Thanking You,
> Darshit Shah
> PGP Fingerprint: 7845 120B 07CB D8D6 ECE5 FF2B 2A17 43ED A91A 35B6
>


-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]