Mercurial > hg > octave-lojdl > gnulib-hg
changeset 5387:21f9e658d032
xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
with errno == ERANGE if the buffer is too small.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 03 Nov 2004 09:24:17 +0000 |
parents | c008e99bcbab |
children | 4966ef3f0d28 |
files | lib/xreadlink.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/xreadlink.c +++ b/lib/xreadlink.c @@ -66,7 +66,9 @@ ssize_t r = readlink (filename, buffer, buf_size); size_t link_length = r; - if (r < 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 (r < 0 && errno != ERANGE) { int saved_errno = errno; free (buffer);