From bfa2612286e765dc52b510fdb753a238f0a1126d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 20 Apr 2004 04:31:12 +0000 Subject: Update. 2004-04-19 Ulrich Drepper * sysdeps/unix/sysv/linux/mq_unlink.c: Rewrite to produce more compact code. --- sysdeps/unix/sysv/linux/mq_unlink.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/unix/sysv/linux/mq_unlink.c b/sysdeps/unix/sysv/linux/mq_unlink.c index 4344c5d..8d87ffa 100644 --- a/sysdeps/unix/sysv/linux/mq_unlink.c +++ b/sysdeps/unix/sysv/linux/mq_unlink.c @@ -32,12 +32,19 @@ mq_unlink (const char *name) return -1; } - int ret = INLINE_SYSCALL (mq_unlink, 1, name + 1); + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (mq_unlink, err, 1, name + 1); /* While unlink can return either EPERM or EACCES, mq_unlink should return just EACCES. */ - if (ret < 0 && errno == EPERM) - __set_errno (EACCES); + if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (ret, err), 0)) + { + ret = INTERNAL_SYSCALL_ERRNO (ret, err); + if (ret == EPERM) + ret = EACCES; + __set_errno (ret); + ret = -1; + } return ret; } -- cgit v1.1