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

ruby-changes:1980

From: ko1@a...
Date: 20 Sep 2007 17:28:18 +0900
Subject: [ruby-changes:1980] nobu - Ruby:r13471 (trunk): * io.c (popen_exec), process.c (rb_spawn): stop other threads before

nobu	2007-09-20 17:28:03 +0900 (Thu, 20 Sep 2007)

  New Revision: 13471

  Modified files:
    trunk/ChangeLog
    trunk/io.c
    trunk/process.c
    trunk/version.h

  Log:
    * io.c (popen_exec), process.c (rb_spawn): stop other threads before
      exec.  [ruby-core:08262]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=13471&r2=13470
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13471&r2=13470
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=13471&r2=13470
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/process.c?r1=13471&r2=13470

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13470)
+++ ChangeLog	(revision 13471)
@@ -1,3 +1,8 @@
+Thu Sep 20 17:28:00 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* io.c (popen_exec), process.c (rb_spawn): stop other threads before
+	  exec.  [ruby-core:08262]
+
 Tue Sep 18 22:08:42 2007  Keiju Ishitsuka  <keiju@r...>
 
 	* lib/matrix.rb: fix a coerce bug of Vector. [ruby-core: 12190]
Index: io.c
===================================================================
--- io.c	(revision 13470)
+++ io.c	(revision 13471)
@@ -3110,6 +3110,7 @@
     struct popen_arg *p = (struct popen_arg*)pp;
     int fd;
 
+    rb_thread_atfork();
     popen_redirect(p);
     for (fd = 3; fd < NOFILE; fd++) {
 #ifdef FD_CLOEXEC
Index: process.c
===================================================================
--- process.c	(revision 13470)
+++ process.c	(revision 13471)
@@ -163,7 +163,7 @@
 static VALUE
 get_ppid(void)
 {
-  rb_secure(2);
+    rb_secure(2);
 #ifdef _WIN32
     return INT2FIX(0);
 #else
@@ -959,7 +959,6 @@
 {
     if (!prog)
 	prog = argv[0];
-    security(prog);
     prog = dln_find_exe(prog, 0);
     if (!prog) {
 	errno = ENOENT;
@@ -1202,6 +1201,7 @@
 {
     VALUE tmp, prog;
     int i;
+    const char *name = 0;
 
     if (argc == 0) {
 	rb_raise(rb_eArgError, "wrong number of arguments");
@@ -1217,12 +1217,15 @@
 	argv[0] = RARRAY_PTR(tmp)[1];
 	SafeStringValue(prog);
 	StringValueCStr(prog);
+	prog = rb_str_new4(prog);
+	name = RSTRING_PTR(prog);
     }
     for (i = 0; i < argc; i++) {
 	SafeStringValue(argv[i]);
+	argv[i] = rb_str_new4(argv[i]);
 	StringValueCStr(argv[i]);
     }
-    security(RSTRING_PTR(prog ? prog : argv[0]));
+    security(name ? name : RSTRING_PTR(argv[0]));
     return prog;
 }
 
@@ -1298,6 +1301,13 @@
     return -1;
 }
 
+static int
+rb_exec_atfork(void* arg)
+{
+    rb_thread_atfork();
+    return rb_exec(arg);
+}
+
 #ifdef HAVE_FORK
 #ifdef FD_CLOEXEC
 #if SIZEOF_INT == SIZEOF_LONG
@@ -1708,7 +1718,7 @@
 	earg.argc = argc;
 	earg.argv = argv;
 	earg.prog = prog ? RSTRING_PTR(prog) : 0;
-	status = rb_fork(&status, (int (*)(void*))rb_exec, &earg);
+	status = rb_fork(&status, rb_exec_atfork, &earg);
 	if (prog && argc) argv[0] = prog;
     }
 #elif defined HAVE_SPAWNV
Index: version.h
===================================================================
--- version.h	(revision 13470)
+++ version.h	(revision 13471)
@@ -1,7 +1,7 @@
 #define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-09-15"
+#define RUBY_RELEASE_DATE "2007-09-20"
 #define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070915
+#define RUBY_RELEASE_CODE 20070920
 #define RUBY_PATCHLEVEL 0
 
 #define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
 #define RUBY_VERSION_TEENY 0
 #define RUBY_RELEASE_YEAR 2007
 #define RUBY_RELEASE_MONTH 9
-#define RUBY_RELEASE_DAY 15
+#define RUBY_RELEASE_DAY 20
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];

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

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