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
This commit is contained in:
yugui 2011-01-16 12:35:15 +00:00
parent 62941003a2
commit 54d8811ce6
3 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,12 @@
Thu Jan 13 00:06:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* io.c (rb_f_syscall): Add warning messages. [ruby-core:34062]
Thu Jan 13 00:00:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* 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) <yugui@yugui.jp> Wed Jan 12 16:25:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* lib/net/http.rb (Net::HTTP#connect): makes it timeout during * lib/net/http.rb (Net::HTTP#connect): makes it timeout during

7
io.c
View file

@ -7563,6 +7563,10 @@ rb_f_syscall(int argc, VALUE *argv)
#endif #endif
int i; 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); rb_secure(2);
if (argc == 0) if (argc == 0)
rb_raise(rb_eArgError, "too few arguments for syscall"); rb_raise(rb_eArgError, "too few arguments for syscall");
@ -7635,7 +7639,8 @@ rb_f_syscall(int argc, VALUE *argv)
#endif #endif
} }
if (retval < 0) rb_sys_fail(0); if (retval == -1)
rb_sys_fail(0);
return RETVAL2NUM(retval); return RETVAL2NUM(retval);
#undef SYSCALL #undef SYSCALL
#undef NUM2SYSCALLID #undef NUM2SYSCALLID

View file

@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2" #define RUBY_VERSION "1.9.2"
#define RUBY_PATCHLEVEL 152 #define RUBY_PATCHLEVEL 153
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1 #define RUBY_VERSION_TEENY 1