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 | c90546cac6a3bcfabe95e39789d8471e87189c7a (patch) | |
tree | fc8fdd2e8603ce6a4fc42817098e2cae928f3737 /file.c | |
parent | ab1acb357cc4e1a520088d31046c959a9890a41b (diff) | |
download | ruby-c90546cac6a3bcfabe95e39789d8471e87189c7a.tar.gz |
* 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/trunk@9537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -2009,13 +2009,11 @@ rb_file_s_readlink(VALUE klass, VALUE path) rb_secure(2); FilePathValue(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); } |