[前][次][番号順一覧][スレッド一覧]

ruby-changes:18503

From: kosaki <ko1@a...>
Date: Wed, 12 Jan 2011 23:16:11 +0900 (JST)
Subject: [ruby-changes:18503] Ruby:r30526 (trunk): * io.c (rb_f_syscall): Some syscall return unsigned or pointer value.

kosaki	2011-01-12 23:16:01 +0900 (Wed, 12 Jan 2011)

  New Revision: 30526

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30526

  Log:
    * 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]

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30525)
+++ ChangeLog	(revision 30526)
@@ -1,3 +1,8 @@
+Thu Jan 13 00:00:07 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* 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 23:55:48 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes
Index: io.c
===================================================================
--- io.c	(revision 30525)
+++ io.c	(revision 30526)
@@ -7931,7 +7931,8 @@
 #endif
     }
 
-    if (retval < 0) rb_sys_fail(0);
+    if (retval == -1)
+	rb_sys_fail(0);
     return RETVAL2NUM(retval);
 #undef SYSCALL
 #undef NUM2SYSCALLID

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]