about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mq/mq_open.c6
-rw-r--r--src/mq/mq_unlink.c5
2 files changed, 2 insertions, 9 deletions
diff --git a/src/mq/mq_open.c b/src/mq/mq_open.c
index 57220a2b..aa91d589 100644
--- a/src/mq/mq_open.c
+++ b/src/mq/mq_open.c
@@ -1,6 +1,5 @@
 #include <mqueue.h>
 #include <fcntl.h>
-#include <errno.h>
 #include <stdarg.h>
 #include "syscall.h"
 
@@ -8,10 +7,7 @@ mqd_t mq_open(const char *name, int flags, ...)
 {
 	mode_t mode = 0;
 	struct mq_attr *attr = 0;
-	if (*name++ != '/') {
-		errno = EINVAL;
-		return -1;
-	}
+	if (*name == '/') name++;
 	if (flags & O_CREAT) {
 		va_list ap;
 		va_start(ap, flags);
diff --git a/src/mq/mq_unlink.c b/src/mq/mq_unlink.c
index 1bb92af1..6a08a4c5 100644
--- a/src/mq/mq_unlink.c
+++ b/src/mq/mq_unlink.c
@@ -5,10 +5,7 @@
 int mq_unlink(const char *name)
 {
 	int ret;
-	if (*name++ != '/') {
-		errno = EINVAL;
-		return -1;
-	}
+	if (*name == '/') name++;
 	ret = __syscall(SYS_mq_unlink, name);
 	if (ret < 0) {
 		if (ret == -EPERM) ret = -EACCES;