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: Darshit Shah
Subject: Re: [Bug-wget] exit status problem with pipe
Date: Mon, 22 Oct 2018 22:02:20 +0200
User-agent: NeoMutt/20180716

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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