[PATCH 2/6] Use INLINE_SYSCALL_ERROR_RETURN
Florian Weimer
fweimer@redhat.com
Tue Oct 13 13:13:00 GMT 2015
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
More information about the Libc-alpha
mailing list