projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
738ef71
)
xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
author
Paul Eggert
<eggert@cs.ucla.edu>
Wed, 3 Nov 2004 09:24:17 +0000
(09:24 +0000)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Wed, 3 Nov 2004 09:24:17 +0000
(09:24 +0000)
with errno == ERANGE if the buffer is too small.
lib/xreadlink.c
patch
|
blob
|
history
diff --git
a/lib/xreadlink.c
b/lib/xreadlink.c
index c38e2d3aad892630f37d84b906b272f93ad7f925..0f5e7d26f2fcd7d27ff462160e0437592d4cf6db 100644
(file)
--- a/
lib/xreadlink.c
+++ b/
lib/xreadlink.c
@@
-66,7
+66,9
@@
xreadlink (char const *filename, size_t size)
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);