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 2/6] Use INLINE_SYSCALL_ERROR_RETURN


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


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