diff options
author | 2014-07-10 13:42:53 +0000 | |
---|---|---|
committer | 2014-07-10 13:42:53 +0000 | |
commit | 228d32200194209ef31f85d91a4f4da3083f4bc7 (patch) | |
tree | f3cf8a6e9d734e051f624ac982f775dd76fcb012 /lib/libc/sys/posix_madvise.c | |
parent | Fewer lies, also do not document DES_3cbc_encrypt anymore. (diff) | |
download | wireguard-openbsd-228d32200194209ef31f85d91a4f4da3083f4bc7.tar.xz wireguard-openbsd-228d32200194209ef31f85d91a4f4da3083f4bc7.zip |
posix_madvise() should return the errno value on error, not -1
ok tedu@ jmc@
Diffstat (limited to 'lib/libc/sys/posix_madvise.c')
-rw-r--r-- | lib/libc/sys/posix_madvise.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/sys/posix_madvise.c b/lib/libc/sys/posix_madvise.c index be310dbd7df..153c28223d1 100644 --- a/lib/libc/sys/posix_madvise.c +++ b/lib/libc/sys/posix_madvise.c @@ -1,13 +1,14 @@ -/* $OpenBSD: posix_madvise.c,v 1.2 2014/07/10 12:46:28 tedu Exp $ */ +/* $OpenBSD: posix_madvise.c,v 1.3 2014/07/10 13:42:53 guenther Exp $ */ /* * Ted Unangst wrote this file and placed it into the public domain. */ #include <sys/mman.h> +#include <errno.h> int _thread_sys_madvise(void *addr, size_t len, int behav); int posix_madvise(void *addr, size_t len, int behav) { - return (_thread_sys_madvise(addr, len, behav)); + return (_thread_sys_madvise(addr, len, behav) ? errno : 0); } |