summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 00:39:04 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 00:39:04 +0000
commit5de33d8fa3804de75b60dd4fcbfebc626c7dac89 (patch)
treed72ee25cbfba24bab072f03daf4fb2289dfead0f
parent4357f31d2525fabc5b3b2ef0fea7fdf0e519da56 (diff)
* process.c (proc_exec_v, rb_proc_exec): preserve errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--process.c7
-rw-r--r--version.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index dcf72fe..e280710 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Aug 22 09:38:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_exec_v, rb_proc_exec): preserve errno.
+
Wed Aug 22 09:00:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occured
diff --git a/process.c b/process.c
index 87fed73..624aeae 100644
--- a/process.c
+++ b/process.c
@@ -117,6 +117,9 @@ static VALUE S_Tms;
#endif
#endif
+#define preserving_errno(stmts) \
+ do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
+
/*
* call-seq:
@@ -990,7 +993,7 @@ proc_exec_v(argv, prog)
before_exec();
rb_thread_cancel_timer();
execv(prog, argv);
- after_exec();
+ preserving_errno(after_exec());
return -1;
}
@@ -1059,7 +1062,7 @@ rb_proc_exec(str)
#else
before_exec();
execl("/bin/sh", "sh", "-c", str, (char *)NULL);
- after_exec();
+ preserving_errno(after_exec());
#endif
#endif
return -1;
diff --git a/version.h b/version.h
index 19e35f3..4b08ac0 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-08-22"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20070822
-#define RUBY_PATCHLEVEL 49
+#define RUBY_PATCHLEVEL 50
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8