bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH,Hurd] bind() fails when umask is 0777


From: Roland McGrath
Subject: Re: [PATCH,Hurd] bind() fails when umask is 0777
Date: Wed, 27 Aug 2014 15:01:48 -0700 (PDT)

> +           if (! err)
> +             if (doretry != FS_RETRY_NORMAL || retryname[0] != '\0')
> +               err = EADDRINUSE;

Please use a simple && expression rather than a nested if here.

> +           /* Get the address port.  */
> +           err = __ifsock_getsockaddr (ifsock, &aport);
> +           if (err == MIG_BAD_ID || err == EOPNOTSUPP)
> +             /* We are not talking to /hurd/ifsock.  Probably
> +                someone came in after we linked our node, unlinked
> +                it, and replaced it with a different node, before we
> +                did our lookup.  Treat it as if our link had failed
> +                with EEXIST.  */
> +             err = EADDRINUSE;

This failure scenario should now be impossible, so I don't think it makes
sense to preserve a comment describing it.  We could remove this check
entirely and just let the underlying error percolate.  But I'd be more
inclined to change it to return EGRATUITOUS because that's exactly the case
here--a system translator with a clear mandate to support a protocol is
failing to support that protocol correctly.

> +               /* Link the node, now a socket with proper mode, into the
> +                * target directory.  */

Fix comment formatting (no *).


Thanks,
Roland



reply via email to

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