Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Aug 2012 07:31:51 +0800
From:      David Xu <listlog2011@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, arch@freebsd.org, David Xu <davidxu@freebsd.org>
Subject:   Re: short read/write and error code
Message-ID:  <5019BC67.9000601@gmail.com>
In-Reply-To: <20120802040542.G2978@besplex.bde.org>
References:  <5018992C.8000207@freebsd.org> <20120801071934.GJ2676@deviant.kiev.zoral.com.ua> <20120801183240.K1291@besplex.bde.org> <20120801162836.GO2676@deviant.kiev.zoral.com.ua> <20120802040542.G2978@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2012/8/2 2:58, Bruce Evans wrote:
> On Wed, 1 Aug 2012, Konstantin Belousov wrote:
>
>> As I said, patch behaviour in regard of SIGPIPE is just wrong.
>
> It is too simple.

The pipe code already reset error code zero if the writer have written 
all bytes
to pipe buffer, it does not return EPIPE even if reader closed the pipe, so
SIGPIPE is not sent in the case.
The SIGPIPE is only generated for short write, this is an intention, it 
is for
applications which takes no notice of short write, such an application 
does not
check return value from write(), when kernel generates SIGPIPE, the 
default action
is to kill the application, if application setup a sigaction for 
SIGPIPE, this implies
that application knows short write. So the patch is correct when it sees 
EPIPE code.

Regards,
David Xu




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5019BC67.9000601>