summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-04-30 10:10:22 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-04-30 10:10:22 +0000
commitcb6d8536338d1eb5ee375ec6c8ece2efd29f7ad0 (patch)
tree05d567d352af31a29cd95ca3a1fee2618bbb0c0a /sys
parent8b3519ff600dfd44fb83658b32e59cfb453bf436 (diff)
Return ENOSYS for unsupported operation.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_futex.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/sys_futex.c b/sys/kern/sys_futex.c
index 0db6a10c7f3..9d2af79da22 100644
--- a/sys/kern/sys_futex.c
+++ b/sys/kern/sys_futex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_futex.c,v 1.1 2017/04/28 13:50:55 mpi Exp $ */
+/* $OpenBSD: sys_futex.c,v 1.2 2017/04/30 10:10:21 mpi Exp $ */
/*
* Copyright (c) 2016-2017 Martin Pieuchot
@@ -85,7 +85,6 @@ sys_futex(struct proc *p, void *v, register_t *retval)
uint32_t val = SCARG(uap, val);
const struct timespec *timeout = SCARG(uap, timeout);
void *g = SCARG(uap, g);
- int error = 0;
switch (op) {
case FUTEX_WAIT:
@@ -106,11 +105,11 @@ sys_futex(struct proc *p, void *v, register_t *retval)
rw_exit_write(&ftlock);
break;
default:
- error = ENOSYS;
+ *retval = ENOSYS;
break;
}
- return (error ? -1 : 0);
+ return 0;
}
/*