info-cvs
[Top][All Lists]
Advanced

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

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


From: Larry Jones
Subject: Re: Possible race in pserver leading to broken pipe error?
Date: Wed, 11 Feb 2004 11:55:45 -0500 (EST)

Derek Robert Price writes:
> 
> Okay... I had just made the assumption that all the descriptors would
> need to be flushed before close if one had, but I see what you are
> getting at now.  The stdout stream had been used and has its own buffer
> so I needed to flush the stdout buf, and similarly the stderr buf, but
> not the descriptors.

Just to reinforce the concept one more time (at the risk of beating a
dead horse), descriptors don't have buffers and thus don't need to be
flushed; *streams* have buffers and need to be flushed; closing a stream
also flushes it.  It's impolite at best to muck about with a stream's
descriptor without at least asking its permission first.  And it's
highly impolite to take a descriptor away (by closing it) from a stream
that's still using it.

-Larry Jones

This game lends itself to certain abuses. -- Calvin




reply via email to

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