ruby-changes:23912
From: akr <ko1@a...>
Date: Fri, 8 Jun 2012 19:57:21 +0900 (JST)
Subject: [ruby-changes:23912] akr:r35963 (trunk): * process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd and
akr 2012-06-08 19:57:10 +0900 (Fri, 08 Jun 2012) New Revision: 35963 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35963 Log: * process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd and proc_exec_sh. (rb_proc_exec): ditto. Modified files: trunk/ChangeLog trunk/process.c Index: ChangeLog =================================================================== --- ChangeLog (revision 35962) +++ ChangeLog (revision 35963) @@ -1,3 +1,9 @@ +Fri Jun 8 19:43:33 2012 Tanaka Akira <akr@f...> + + * process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd and + proc_exec_sh. + (rb_proc_exec): ditto. + Fri Jun 8 19:00:59 2012 Tanaka Akira <akr@f...> * process.c (ARGV_COUNT): unused macro removed. Index: process.c =================================================================== --- process.c (revision 35962) +++ process.c (revision 35963) @@ -1117,8 +1117,7 @@ execve(prog, argv, envp); /* async-signal-safe */ else execv(prog, argv); /* async-signal-safe */ - preserving_errno(try_with_sh(prog, argv, envp); /* try_with_sh() is async-signal-safe. */ - after_exec()); /* after_exec() is not async-signal-safe */ + preserving_errno(try_with_sh(prog, argv, envp)); /* try_with_sh() is async-signal-safe. */ # if defined(__EMX__) || defined(OS2) if (new_argv) { xfree(new_argv[0]); @@ -1148,7 +1147,6 @@ #ifdef _WIN32 before_exec(); rb_w32_spawn(P_OVERLAY, (char *)str, 0); - after_exec(); return -1; #else #if defined(__CYGWIN32__) || defined(__EMX__) @@ -1161,7 +1159,6 @@ execl(shell, "sh", "-c", str, (char *) NULL); else status = system(str); - after_exec(); if (status != -1) exit(status); } @@ -1171,7 +1168,6 @@ execle("/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */ else execl("/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe */ - preserving_errno(after_exec()); /* xxx: not async-signal-safe because after_exec calls rb_thread_start_timer_thread. */ #endif return -1; #endif /* _WIN32 */ @@ -1181,7 +1177,9 @@ int rb_proc_exec(const char *str) { - return proc_exec_sh(str, Qfalse); + int ret = proc_exec_sh(str, Qfalse); + preserving_errno(after_exec()); + return ret; } enum { @@ -2615,6 +2613,7 @@ #else # undef sargp #endif + preserving_errno(after_exec()); /* xxx: not async-signal-safe because after_exec calls rb_thread_start_timer_thread. */ return -1; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/