This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] New internal function __access_noerrno
On Nov 10 2016, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> diff --git a/hurd/hurd.h b/hurd/hurd.h
> index ec07827..8bcb1ec 100644
> --- a/hurd/hurd.h
> +++ b/hurd/hurd.h
> @@ -75,6 +75,36 @@ __hurd_fail (error_t err)
> errno = err;
> return -1;
> }
> +
> +_HURD_H_EXTERN_INLINE int
> +__hurd_fail_noerrno (error_t err)
> +{
> + switch (err)
> + {
> + case EMACH_SEND_INVALID_DEST:
> + case EMIG_SERVER_DIED:
> + /* The server has disappeared! */
> + err = EIEIO;
> + break;
> +
> + case KERN_NO_SPACE:
> + err = ENOMEM;
> + break;
> +
> + case KERN_INVALID_ARGUMENT:
> + err = EINVAL;
> + break;
> +
> + case 0:
> + return 0;
> +
> + default:
> + break;
> + }
> +
> + errno = err;
Isn't that supposed to _not_ set errno?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."