From: Bruno Haible Date: Fri, 12 Jan 2007 16:25:21 +0000 (+0000) Subject: Fix for AIX and HP-UX. X-Git-Tag: v0.17~511 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80b485a30c4e6efce83fe0973e0059faa815e327;p=thirdparty%2Fgettext.git Fix for AIX and HP-UX. --- diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index b17704845..d26f46245 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,8 @@ +2007-01-12 Bruno Haible + + * 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 * 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 44e372eee..51714cd57 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) {