summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/shmat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/shmat.c')
-rw-r--r--sysdeps/unix/sysv/linux/shmat.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/shmat.c b/sysdeps/unix/sysv/linux/shmat.c
index 94d18d3f66..45ebd1177c 100644
--- a/sysdeps/unix/sysv/linux/shmat.c
+++ b/sysdeps/unix/sysv/linux/shmat.c
@@ -42,11 +42,10 @@ shmat (shmid, shmaddr, shmflg)
 				shmid, shmflg,
 				(long int) &raddr,
 				(void *) shmaddr);
-  if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))
-    {
-      __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err));
-      return (void *) -1l;
-    }
-
-  return raddr;
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, err)))
+    return INLINE_SYSCALL_ERROR_RETURN (-INTERNAL_SYSCALL_ERRNO (resultvar,
+								 err),
+					void *, -1l);
+  else
+    return raddr;
 }