This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.28.9000-303-gb15b1a9


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  b15b1a959040fe8cdfbc51092a7b72032f6c9b86 (commit)
      from  0c7f97aead9bf82f868d39cf7dc179caf224189a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b15b1a959040fe8cdfbc51092a7b72032f6c9b86

commit b15b1a959040fe8cdfbc51092a7b72032f6c9b86
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Nov 19 20:22:30 2018 +0100

    hurd: Support lockf at offset 0 with size 0 or 1.
    
    	* sysdeps/mach/hurd/f_setlk.c: Include <unistd.h>.
    	(__f_setlk): When whence is SEEK_CUR, use __lseek64 to convert it to
    	SEEK_SET.

diff --git a/ChangeLog b/ChangeLog
index fdd7bf3..bb2824c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-19  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/f_setlk.c: Include <unistd.h>.
+	(__f_setlk): When whence is SEEK_CUR, use __lseek64 to convert it to
+	SEEK_SET.
+
 2018-11-19  Mao Han  <han_mao@c-sky.com>
 
 	* scripts/config.guess: Update to version 2018-08-29.
diff --git a/sysdeps/mach/hurd/f_setlk.c b/sysdeps/mach/hurd/f_setlk.c
index 718af67..edfb292 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 <unistd.h>
 #include <errno.h>
 
 /* XXX
@@ -45,6 +46,18 @@ __f_setlk (int fd, int type, int whence, __off64_t start, __off64_t len, int wai
   if (cmd != LOCK_UN && wait == 0)
     cmd |= LOCK_NB;
 
+  if (whence == SEEK_CUR)
+    {
+      /* In case the target position is 0, we can support it below.  */
+      __off64_t cur = __lseek64 (fd, 0, SEEK_CUR);
+
+      if (cur >= 0)
+	{
+	  start = cur + start;
+	  whence = SEEK_SET;
+	}
+    }
+
   switch (whence)
     {
     case SEEK_SET:

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |    6 ++++++
 sysdeps/mach/hurd/f_setlk.c |   13 +++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]