From b6e97b0af194bbee11d5f727618746e8125d3379 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Thu, 13 Sep 2001 14:05:17 +0000 Subject: [PATCH] (current_lock_owner): If readlink returns ERANGE, take that to mean that the buffer is too small. --- src/filelock.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/filelock.c b/src/filelock.c index 44db9722f91..6e78a05e309 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -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); -- 2.39.5