changeset 39283:ba947b6fd6ae

(current_lock_owner): If readlink returns ERANGE, take that to mean that the buffer is too small.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 13 Sep 2001 14:05:17 +0000
parents 468b3ac5ff23
children 27f628743baa
files src/filelock.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/filelock.c	Thu Sep 13 14:01:54 2001 +0000
+++ b/src/filelock.c	Thu Sep 13 14:05:17 2001 +0000
@@ -436,6 +436,11 @@
       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);