summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-15 19:36:03 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-15 19:36:03 +0000
commitef159096d1ce0fdd99125c17f2531e4407d059f4 (patch)
tree6b316ae4076e230ae97d6cebc2fcf7a4a320761a
parentf1534dd543df3253520f5f27cafeb10a734deabe (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_5@12964 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 5b460092d93..84923948732 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Aug 16 04:34:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_exec_v, rb_proc_exec): preserve errno.
+
Thu Aug 16 04:30:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (rb_path2class): get rid of dangling pointer caused by
diff --git a/process.c b/process.c
index 6064cd11425..00b557b379b 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:
@@ -989,7 +992,7 @@ proc_exec_v(argv, prog)
#endif /* MSDOS or __human68k__ or __EMX__ */
before_exec();
execv(prog, argv);
- after_exec();
+ preserving_errno(after_exec());
return -1;
}
@@ -1058,7 +1061,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 80f90950c34..e1222098c36 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-08-16"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20070816
-#define RUBY_PATCHLEVEL 60
+#define RUBY_PATCHLEVEL 61
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8