Skip to content

Commit

Permalink
* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Treat a struct flock with
Browse files Browse the repository at this point in the history
	l_start == 0 and l_len == 1 as we do l_len == 0.
  • Loading branch information
Roland McGrath committed Nov 10, 2002
1 parent da43dd4 commit 8bbd8b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2002-11-10 Roland McGrath <roland@frob.com>

* 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.

2002-11-10 Ulrich Drepper <drepper@redhat.com>

* po/da.po: Update from translation team.
Expand Down
7 changes: 6 additions & 1 deletion sysdeps/mach/hurd/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8bbd8b0

Please sign in to comment.