summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-03-25 02:36:33 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-03-25 02:36:33 +0100
commitca440b5797e0ad7cc679722168477992c36c785a (patch)
treeea9d9c19ed3675311a9faac780a4bcd6c555ec8a
parentc772618f22088acfe2a131e4cdedc324226de3cb (diff)
parentd6c4cb95124a9d0a50ece695cb15c6fd84922d9a (diff)
Merge branch 't/lockf64' into refs/top-bases/tschwinge/Roger_Whittaker
-rw-r--r--sysdeps/mach/hurd/Makefile4
-rw-r--r--sysdeps/mach/hurd/f_setlk.c2
-rw-r--r--sysdeps/mach/hurd/f_setlk.h1
-rw-r--r--sysdeps/mach/hurd/fcntl.c10
4 files changed, 11 insertions, 6 deletions
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 7df96f827e..e47baa129f 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -195,6 +195,10 @@ ifeq (hurd, $(subdir))
sysdep_routines += cthreads
endif
+ifeq (io, $(subdir))
+sysdep_routines += f_setlk
+endif
+
ifeq ($(subdir),sunrpc)
sysdep_headers += nfs/nfs.h
endif
diff --git a/sysdeps/mach/hurd/f_setlk.c b/sysdeps/mach/hurd/f_setlk.c
index 9c898b130b..6e1b308756 100644
--- a/sysdeps/mach/hurd/f_setlk.c
+++ b/sysdeps/mach/hurd/f_setlk.c
@@ -29,7 +29,7 @@
int
__f_setlk (int fd, int type, int whence, __off64_t start, __off64_t len, int wait)
{
- int cmd;
+ int cmd = 0;
switch (type)
{
diff --git a/sysdeps/mach/hurd/f_setlk.h b/sysdeps/mach/hurd/f_setlk.h
index a9d09fd90a..16c7a8ca8d 100644
--- a/sysdeps/mach/hurd/f_setlk.h
+++ b/sysdeps/mach/hurd/f_setlk.h
@@ -19,4 +19,5 @@
#define _F_SETLK_H 1
extern int __f_setlk (int fd, int type, int whence, __off64_t start, __off64_t len, int wait);
+
#endif /* f_setlk.h */
diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index a7ef21be1c..076f2eaa71 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -142,7 +142,7 @@ __libc_fcntl (int fd, int cmd, ...)
/* FALLTHROUGH */
case F_SETLK:
return __f_setlk (fd, fl->l_type, fl->l_whence,
- fl->l_start, fl->l_end, wait);
+ fl->l_start, fl->l_len, wait);
default:
errno = EINVAL;
return -1;
@@ -153,7 +153,7 @@ __libc_fcntl (int fd, int cmd, ...)
case F_SETLK64:
case F_SETLKW64:
{
- struct flock64 *fl64 = va_arg (ap, struct flock64 *);
+ struct flock64 *fl = va_arg (ap, struct flock64 *);
int wait = 0;
va_end (ap);
switch (cmd)
@@ -161,12 +161,12 @@ __libc_fcntl (int fd, int cmd, ...)
case F_GETLK64:
errno = ENOSYS;
return -1;
- case F_SETLK64:
+ case F_SETLKW64:
wait = 1;
/* FALLTHROUGH */
- case F_SETLKW64:
+ case F_SETLK64:
return __f_setlk (fd, fl->l_type, fl->l_whence,
- fl->l_start, fl->l_end, wait);
+ fl->l_start, fl->l_len, wait);
default:
errno = EINVAL;
return -1;