This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> +	      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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]