[BusyBox] Re: syslogd sometimes dies writing to remote logger

Manuel Novoa III mjn3 at codepoet.org
Tue Apr 2 11:40:04 UTC 2002


Matt,

On Tue, Apr 02, 2002 at 08:06:26AM -0800, Matt Kraai wrote:
> On Mon, Apr 01, 2002 at 10:11:59PM -0800, larry at doolittle.boa.org wrote:
> >     writev_retry:
> >        if ( -1 == writev(remotefd,iov, IOV_COUNT)){
> >            if (errno == EINTR) goto writev_retry;
> >            error_msg_and_die("syslogd: cannot write to remote file handle on"
> >                  "%s:%d",RemoteHost,RemotePort);
> >        }
> > 
> > Purists should resist the urge to rewrite this without the goto,
> > since a goto is (in this case) the clearest way to express the intent.
> 
> Hey, I think the code for safe_read is perfectly clear (in my
> unbiased opinion).

True but full_write does no EINTR checking... and it seems silly to go
on a "what calls can fail with EINTR" hunt.  Wouldn't it just be better
to force restartable syscalls and ignore EINTR entirely?  Especially
since, if you use POSIX signal semantics and don't restart syscalls,
even stdio functions like fputc() can fail with EINTR (which is why I
had to remove EINTR checking in uClibc's stdio lib).  Who wants to
do EINTR checking on every stdio call?

Manuel




More information about the busybox mailing list