about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-04-19 17:28:57 +0000
committerUlrich Drepper <drepper@redhat.com>2004-04-19 17:28:57 +0000
commit0a901ba456d0a0e6dfd0488b3f20f03d9e103d6f (patch)
treea6297b186f5aecd0a0466f6f44f074c8613c8be2 /sysdeps/unix/sysv
parent72c41589771584da6693ca8a340a19d1cd6bef06 (diff)
downloadglibc-0a901ba456d0a0e6dfd0488b3f20f03d9e103d6f.tar.gz
glibc-0a901ba456d0a0e6dfd0488b3f20f03d9e103d6f.tar.xz
glibc-0a901ba456d0a0e6dfd0488b3f20f03d9e103d6f.zip
Update.
2004-04-19  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/mq_unlink.c (mq_unlink): Change EPERM into
	EACCES.
	* rt/Makefile (tests): Add tst-mqueue9.
	* rt/tst-mqueue9.c: New test.
	* rt/tst-mqueue4.c (do_test): Add test for mq_unlink of a too long
	name component.

2004-04-19  Ulrich Drepper  <drepper@redhat.com>

	* rt/tst-mqueue7.c (do_test): Make newargv const.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/mq_unlink.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/mq_unlink.c b/sysdeps/unix/sysv/linux/mq_unlink.c
index 8da70ea42b..4344c5d0ef 100644
--- a/sysdeps/unix/sysv/linux/mq_unlink.c
+++ b/sysdeps/unix/sysv/linux/mq_unlink.c
@@ -31,7 +31,15 @@ mq_unlink (const char *name)
       __set_errno (EINVAL);
       return -1;
     }
-  return INLINE_SYSCALL (mq_unlink, 1, name + 1);
+
+  int ret = INLINE_SYSCALL (mq_unlink, 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);
+
+  return ret;
 }
 
 #else