]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix for AIX and HP-UX.
authorBruno Haible <bruno@clisp.org>
Fri, 12 Jan 2007 16:25:21 +0000 (16:25 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:36 +0000 (12:14 +0200)
gnulib-local/ChangeLog
gnulib-local/lib/xreadlink.c

index b17704845d4820b3b41dfc6b794a41997aa292c4..d26f46245d49ea8d28122eca5e2c1e29dafd09e9 100644 (file)
@@ -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
index 44e372eeef690fde8f0a6cad081936e7f0c0dc01..51714cd577f88c469999041a4644cd246fc35f1d 100644 (file)
@@ -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)
            {