about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/fcntl.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-11-10 23:29:38 +0000
committerRoland McGrath <roland@gnu.org>2002-11-10 23:29:38 +0000
commit8bbd8b0ba260a124edd42495b4194c7b9c30d0bc (patch)
tree3e4428a04300c9b7d454842ab9d3a340163ce764 /sysdeps/mach/hurd/fcntl.c
parentda43dd4f9980fde957127b70f4024eaffed4e8d2 (diff)
downloadglibc-8bbd8b0ba260a124edd42495b4194c7b9c30d0bc.tar.gz
glibc-8bbd8b0ba260a124edd42495b4194c7b9c30d0bc.tar.xz
glibc-8bbd8b0ba260a124edd42495b4194c7b9c30d0bc.zip
* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Treat a struct flock with
	l_start == 0 and l_len == 1 as we do l_len == 0.
Diffstat (limited to 'sysdeps/mach/hurd/fcntl.c')
-rw-r--r--sysdeps/mach/hurd/fcntl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index 275f6b003d..d4e4aa5da1 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -155,7 +155,12 @@ __libc_fcntl (int fd, int cmd, ...)
 	switch (fl->l_whence)
 	  {
 	  case SEEK_SET:
-	    if (fl->l_start == 0 && fl->l_len == 0)
+	    if (fl->l_start == 0 && fl->l_len == 0) /* Whole file request.  */
+	      break;
+	    /* It seems to be common for applications to lock the first
+	       byte of the file when they are really doing whole-file locking.
+	       So, since it's so wrong already, might as well do that too.  */
+	    if (fl->l_start == 0 && fl->l_len == 1)
 	      break;
 	    /* FALLTHROUGH */
 	  case SEEK_CUR: