summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-01-12 16:25:21 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:14:36 +0200
commit80b485a30c4e6efce83fe0973e0059faa815e327 (patch)
treec9fe7e0563721973ed125a5dc4bc3abfbc1006ef
parent96653699f028aa557815bee8ce9c402be29cd001 (diff)
downloadexternal_gettext-80b485a30c4e6efce83fe0973e0059faa815e327.zip
external_gettext-80b485a30c4e6efce83fe0973e0059faa815e327.tar.gz
external_gettext-80b485a30c4e6efce83fe0973e0059faa815e327.tar.bz2
Fix for AIX and HP-UX.
-rw-r--r--gnulib-local/ChangeLog5
-rw-r--r--gnulib-local/lib/xreadlink.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog
index b177048..d26f462 100644
--- a/gnulib-local/ChangeLog
+++ b/gnulib-local/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-12 Bruno Haible <bruno@clisp.org>
+
+ * lib/xreadlink.c (xreadlink): Handle an ERANGE error. Needed for
+ AIX and HP-UX. Based on a gnulib patch from Paul Eggert on 2004-11-03.
+
2006-12-23 Bruno Haible <bruno@clisp.org>
* term-ostream.oo.c (out_attr_change): Consider the side effects of
diff --git a/gnulib-local/lib/xreadlink.c b/gnulib-local/lib/xreadlink.c
index 44e372e..51714cd 100644
--- a/gnulib-local/lib/xreadlink.c
+++ b/gnulib-local/lib/xreadlink.c
@@ -1,6 +1,6 @@
/* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage
- Copyright (C) 2001, 2003, 2005-2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -74,7 +74,9 @@ xreadlink (char const *filename)
/* Attempt to read the link into the current buffer. */
ssize_t link_length = readlink (filename, buffer, buf_size);
- if (link_length < 0)
+ /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1
+ with errno == ERANGE if the buffer is too small. */
+ if (link_length < 0 && errno != ERANGE)
{
if (buffer != initial_buf)
{