summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-12 14:16:01 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-12 14:16:01 +0000
commitda235830b561960905d62604fa0dc6b56e640900 (patch)
treed442a84491d693036dff5212eebafcf1d274dedb /io.c
parentcaab5dcee77d8278fdf578334b6d4e7f8595052e (diff)
* io.c (rb_f_syscall): Some syscall return unsigned or pointer value.
Therefore we should only check the result is -1 or not. [ruby-core:34062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index f8aa6dd3f7..2fcc46b139 100644
--- a/io.c
+++ b/io.c
@@ -7931,7 +7931,8 @@ rb_f_syscall(int argc, VALUE *argv)
#endif
}
- if (retval < 0) rb_sys_fail(0);
+ if (retval == -1)
+ rb_sys_fail(0);
return RETVAL2NUM(retval);
#undef SYSCALL
#undef NUM2SYSCALLID