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

ruby-changes:18660

From: kosaki <ko1@a...>
Date: Fri, 28 Jan 2011 11:00:18 +0900 (JST)
Subject: [ruby-changes:18660] Ruby:r30685 (trunk): * configure.in: Added mode_t type checking.

kosaki	2011-01-28 11:00:08 +0900 (Fri, 28 Jan 2011)

  New Revision: 30685

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

  Log:
    * configure.in: Added mode_t type checking.
    * process.c (rb_exec_arg_addopt): Use NUM2MODET() instead
      NUM2LONG because clang makes compile error by this narrowing
      conversion.
    * process.c (rb_run_exec_options_err): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/process.c

Index: configure.in
===================================================================
--- configure.in	(revision 30684)
+++ configure.in	(revision 30685)
@@ -686,6 +686,7 @@
 RUBY_REPLACE_TYPE(gid_t, int, GIDT)
 RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
 RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
+RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include <sys/stat.h>])
 
 AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
   [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30684)
+++ ChangeLog	(revision 30685)
@@ -1,3 +1,11 @@
+Fri Jan 28 10:58:20 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* configure.in: Added mode_t type checking.
+	* process.c (rb_exec_arg_addopt): Use NUM2MODET() instead
+	  NUM2LONG because clang makes compile error by this narrowing
+	  conversion.
+	* process.c (rb_run_exec_options_err): ditto.
+
 Fri Jan 28 02:37:18 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* re.c (rb_reg_raise): add GC guard to prevent intermediate
Index: process.c
===================================================================
--- process.c	(revision 30684)
+++ process.c	(revision 30685)
@@ -1516,7 +1516,7 @@
                                   hide_obj(rb_str_dup(val)));
         }
         else if (id == rb_intern("umask")) {
-            mode_t cmask = NUM2LONG(val);
+	    mode_t cmask = NUM2MODET(val);
             if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_UMASK))) {
                 rb_raise(rb_eArgError, "umask option specified twice");
             }
@@ -2335,7 +2335,7 @@
 
     obj = rb_ary_entry(options, EXEC_OPTION_UMASK);
     if (!NIL_P(obj)) {
-        mode_t mask = NUM2LONG(obj);
+        mode_t mask = NUM2MODET(obj);
         mode_t oldmask = umask(mask); /* never fail */
         if (!NIL_P(soptions))
             rb_ary_store(soptions, EXEC_OPTION_UMASK, LONG2NUM(oldmask));

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

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