]> git.eshelyaron.com Git - emacs.git/commitdiff
(current_lock_owner): If readlink returns ERANGE,
authorGerd Moellmann <gerd@gnu.org>
Thu, 13 Sep 2001 14:05:17 +0000 (14:05 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 13 Sep 2001 14:05:17 +0000 (14:05 +0000)
take that to mean that the buffer is too small.

src/filelock.c

index 44db9722f91048c165114f79b72731eb2b60b6c4..6e78a05e30954022807059011b236f1f6b4017f6 100644 (file)
@@ -436,6 +436,11 @@ current_lock_owner (owner, lfname)
       bufsize *= 2;
       lfinfo = (char *) xrealloc (lfinfo, bufsize);
       len = readlink (lfname, lfinfo, bufsize);
+#ifdef ERANGE
+      /* HP-UX reports ERANGE if the buffer is too small.  */
+      if (len == -1 && errno == ERANGE)
+       continue;
+#endif
     }
   while (len >= bufsize);