Skip to content

Commit

Permalink
merges r30526 and r30527 from trunk into ruby_1_9_2.
Browse files Browse the repository at this point in the history
--
	* 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
  • Loading branch information
yugui committed Jan 16, 2011
1 parent 6294100 commit 54d8811
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
@@ -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>

* lib/net/http.rb (Net::HTTP#connect): makes it timeout during
Expand Down
7 changes: 6 additions & 1 deletion io.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 54d8811

Please sign in to comment.