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?

_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to