This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/6] Use INLINE_SYSCALL_ERROR_RETURN
- From: Florian Weimer <fweimer at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 13 Oct 2015 15:13:44 +0200
- Subject: Re: [PATCH 2/6] Use INLINE_SYSCALL_ERROR_RETURN
- Authentication-results: sourceware.org; auth=none
- References: <20151012231944 dot GA27441 at intel dot com>
On 10/13/2015 01:19 AM, H.J. Lu wrote:
> diff --git a/sysdeps/unix/sysv/linux/shmat.c b/sysdeps/unix/sysv/linux/shmat.c
> index 94d18d3..3f6388b 100644
> --- a/sysdeps/unix/sysv/linux/shmat.c
> +++ b/sysdeps/unix/sysv/linux/shmat.c
> @@ -43,10 +43,8 @@ shmat (shmid, shmaddr, shmflg)
> (long int) &raddr,
> (void *) shmaddr);
> if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))
> - {
> - __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err));
> - return (void *) -1l;
> - }
> + return (void *) INLINE_SYSCALL_ERROR_RETURN (INTERNAL_SYSCALL_ERRNO (resultvar,
> + err));
Please put in a cast to ptrdiff_t before the cast to void *. This makes
it more likely that we get the desired sign extension. Or use MAP_FAILED.
Apart from my concern regarding the macro name, the rest looks good.
Thanks,
Florian