diff --git a/ChangeLog b/ChangeLog index d6921e15f8..c4e75f0587 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Jan 13 00:06:38 2011 KOSAKI Motohiro + + * io.c (rb_f_syscall): Add warning messages. [ruby-core:34062] + +Thu Jan 13 00:00:07 2011 KOSAKI Motohiro + + * 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] + Wed Jan 12 16:25:12 2011 Yuki Sonoda (Yugui) * lib/net/http.rb (Net::HTTP#connect): makes it timeout during diff --git a/io.c b/io.c index 22877dcce3..0a110f9ea2 100644 --- a/io.c +++ b/io.c @@ -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 diff --git a/version.h b/version.h index b87cd5859f..d30bdd2a36 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 152 +#define RUBY_PATCHLEVEL 153 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1