svn commit: r271753 - head/sys/fs/autofs

Edward Tomasz Napierala trasz at FreeBSD.org
Thu Sep 18 13:12:22 UTC 2014


On 0918T1421, Konstantin Belousov wrote:
> On Thu, Sep 18, 2014 at 10:33:23AM +0000, Edward Tomasz Napierala wrote:
> > Author: trasz
> > Date: Thu Sep 18 10:33:23 2014
> > New Revision: 271753
> > URL: http://svnweb.freebsd.org/changeset/base/271753
> > 
> > Log:
> >   Fix typos.
> >   
> >   Sponsored by:	The FreeBSD Foundation
> > 
> > Modified:
> >   head/sys/fs/autofs/autofs.c
> > 
> > Modified: head/sys/fs/autofs/autofs.c
> > ==============================================================================
> > --- head/sys/fs/autofs/autofs.c	Thu Sep 18 10:01:56 2014	(r271752)
> > +++ head/sys/fs/autofs/autofs.c	Thu Sep 18 10:33:23 2014	(r271753)
> > @@ -430,7 +430,7 @@ autofs_trigger_one(struct autofs_node *a
> >  			autofs_restore_sigmask(&oldset);
> >  			if (error != 0) {
> >  				/*
> > -				 * XXX: For some reson this returns -1
> > +				 * XXX: For some reason this returns -1
> >  				 *	instead of EINTR, wtf?!
> >  				 */
> >  				error = EINTR;
> > @@ -542,7 +542,7 @@ autofs_ioctl_request(struct autofs_daemo
> >  		    &autofs_softc->sc_lock);
> >  		if (error != 0) {
> >  			/*
> > -			 * XXX: For some reson this returns -1 instead
> > +			 * XXX: For some reason this returns -1 instead
> >  			 * 	of EINTR, wtf?!
> >  			 */
> >  			error = EINTR;
> The -1 is ERESTART, i.e. it is correct error value which indicates that
> syscall return path must restart the syscall after the trip to userland.
> This behaviour is controlled by SA_RESTART flag, see sigaction(2).

Ah, I didn't realize it's a valid error number.

> There are some syscalls, which explicitely deny restarting, mostly to
> correctly handle timeout values, most prominent is select(2) family.
> 
> The comment above is definitely inappropriate, and translation of ERESTART
> to EINTR may be wrong as well.

The whole point of this is to fail the syscall with EINTR.  However,
I'm not sure what makes cv_wait_sig(9) to return with ERESTART instead
of EINTR.  Is SA_RESTART set by default?



More information about the svn-src-all mailing list