diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-14 14:52:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-14 14:52:55 +0000 |
commit | b750e49434834b04735987a48d2f3b68d9e55ef5 (patch) | |
tree | 03297ce8bb5422827be37b9b9906012730c98aa0 | |
parent | 5028ce7133a9fd9ff20b30bcddb76f385168932b (diff) |
* file.c (rb_file_s_readlink): ERANGE will occur only on GPFS.
[ruby-dev:27699]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | file.c | 10 |
2 files changed, 9 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Mon Nov 14 23:49:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * file.c (rb_file_s_readlink): ERANGE will occur only on GPFS. + [ruby-dev:27699] + Mon Nov 14 17:36:22 2005 Yukihiro Matsumoto <matz@ruby-lang.org> * array.c (rb_ary_first): RDoc update from Daniel Berger @@ -2051,13 +2051,11 @@ rb_file_s_readlink(klass, path) SafeStringValue(path); buf = xmalloc(size); - for (;;) { - rv = readlink(RSTRING(path)->ptr, buf, size); -#ifndef _AIX - if (rv != size) break; -#else - if (rv > 0 || errno != ERANGE) break; + while ((rv = readlink(RSTRING(path)->ptr, buf, size)) == size +#ifdef _AIX + || (rv < 0 && errno == ERANGE) /* quirky behavior of GPFS */ #endif + ) { size *= 2; buf = xrealloc(buf, size); } |