Patch for stdout/stderr buffer flush write() handling

Markus Friedl markus.friedl at informatik.uni-erlangen.de
Sun Jun 17 19:01:38 EST 2001


On Sat, Jun 16, 2001 at 01:57:31PM -0700, Carson Gaspar wrote:
> 
> 
> --On Saturday, June 16, 2001 10:36 AM +0200 Markus Friedl 
> <markus.friedl at informatik.uni-erlangen.de> wrote:
> 
> > On Fri, Jun 15, 2001 at 03:19:16PM -0700, Carson Gaspar wrote:
> >> The attached patch against today's CVS improves write() error handling
> >> and  logging in clientloop.c when flushing stdout/stderr.
> >
> > you can get EAGAIN if the fd is blocking?
> 
> Not on any UNIX I know of, but that's not the point. EAGAIN is a non-fatal 
> error, and we've just encountered a situation where another part of the 
> code made the fd non-blocking. The old code couldn't handle this, and died. 

but this was the right thing to do. otherwise we
had a busy loop. so it lead to the discovery of an
actual bug.

> After the patch, it will do the right thing no matter what. This makes the 
> code more resilient to bizarre OS behaviour, and to intentional or 
> unintentional code changes.



More information about the openssh-unix-dev mailing list