diff options
Diffstat (limited to 'sysdeps/mach/hurd/f_setlk.c')
-rw-r--r-- | sysdeps/mach/hurd/f_setlk.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sysdeps/mach/hurd/f_setlk.c b/sysdeps/mach/hurd/f_setlk.c index 5c60a6347c..9f1b0baa6c 100644 --- a/sysdeps/mach/hurd/f_setlk.c +++ b/sysdeps/mach/hurd/f_setlk.c @@ -19,6 +19,7 @@ #include <sys/types.h> #include <sys/file.h> #include <fcntl.h> +#include <hurd.h> #include <unistd.h> #include <errno.h> @@ -39,8 +40,7 @@ __f_setlk (int fd, int type, int whence, __off64_t start, __off64_t len, int wai case F_WRLCK: cmd = LOCK_EX; break; case F_UNLCK: cmd = LOCK_UN; break; default: - errno = EINVAL; - return -1; + return __hurd_fail (EINVAL); } if (cmd != LOCK_UN && wait == 0) @@ -71,11 +71,9 @@ __f_setlk (int fd, int type, int whence, __off64_t start, __off64_t len, int wai /* FALLTHROUGH */ case SEEK_CUR: case SEEK_END: - errno = ENOTSUP; - return -1; + return __hurd_fail (ENOTSUP); default: - errno = EINVAL; - return -1; + return __hurd_fail (EINVAL); } return __flock (fd, cmd); |