diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-16 12:35:15 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-16 12:35:15 +0000 |
commit | 54d8811ce66c27cd5af6341f58e482f0c4d8d79f (patch) | |
tree | 4f03a4a2a07fb97305084b144ddda009f0eee78e /io.c | |
parent | 62941003a2f5314e80daf0c16e51881f0d177ff5 (diff) |
merges r30526 and r30527 from trunk into ruby_1_9_2.
--
* 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]
--
* io.c (rb_f_syscall): Add warning messages. [ruby-core:34062]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -7562,6 +7562,10 @@ rb_f_syscall(int argc, VALUE *argv) int num, retval = -1; #endif int i; + + if (RTEST(ruby_verbose)) { + rb_warning("We plan to remove a syscall function at future release. DL(Fiddle) provides safer alternative."); + } rb_secure(2); if (argc == 0) @@ -7635,7 +7639,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 |