[Top][All Lists]

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

Re: Possible race in pserver leading to broken pipe error?

From: Steve McIntyre
Subject: Re: Possible race in pserver leading to broken pipe error?
Date: Wed, 11 Feb 2004 00:38:56 +0000
User-agent: Mutt/

On Tue, Feb 10, 2004 at 07:23:43PM -0500, Derek Robert Price wrote:
>Hash: SHA1
>Larry Jones wrote:
>>Derek Robert Price writes:
>>>Yep, it just needed fflushes.  Working patch attached.  Comments before
>>>I commit?
>>fflush()/close() is a no-no -- you want fclose() instead.  Once you've
>>attached a stream to a file descriptor, you have to be very careful
>>about what you do to the file descriptor -- it's best to only use the
>>stream from then on.
>Why, if you don't mind me asking?  I couldn't find a man page for a file
>descriptor flush - is there some way I could have flushed the pipe
>without attaching the stream?

fsync() or fdatasync() should do what you want here. Although you
_should_ be able to mix stream and fd operations normally - stdio is
meant to do the right thing AFAIK. But now I can't find the reference
I had that said so, of course.

Steve McIntyre, Cambridge, UK.                                address@hidden
Into the distance, a ribbon of black
Stretched to the point of no turning back

Attachment: signature.asc
Description: Digital signature

reply via email to

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