ruby-changes:1659
From: ko1@a...
Date: 22 Aug 2007 09:39:11 +0900
Subject: [ruby-changes:1659] shyouhei - Ruby:r13150 (ruby_1_8_6): * process.c (proc_exec_v, rb_proc_exec): preserve errno.
shyouhei 2007-08-22 09:39:04 +0900 (Wed, 22 Aug 2007)
New Revision: 13150
Modified files:
branches/ruby_1_8_6/ChangeLog
branches/ruby_1_8_6/process.c
branches/ruby_1_8_6/version.h
Log:
* process.c (proc_exec_v, rb_proc_exec): preserve errno.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ChangeLog?r1=13150&r2=13149
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=13150&r2=13149
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/process.c?r1=13150&r2=13149
Index: ruby_1_8_6/process.c
===================================================================
--- ruby_1_8_6/process.c (revision 13149)
+++ ruby_1_8_6/process.c (revision 13150)
@@ -117,7 +117,10 @@
#endif
#endif
+#define preserving_errno(stmts) \
+ do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
+
/*
* call-seq:
* Process.pid => fixnum
@@ -990,7 +993,7 @@
before_exec();
rb_thread_cancel_timer();
execv(prog, argv);
- after_exec();
+ preserving_errno(after_exec());
return -1;
}
@@ -1059,7 +1062,7 @@
#else
before_exec();
execl("/bin/sh", "sh", "-c", str, (char *)NULL);
- after_exec();
+ preserving_errno(after_exec());
#endif
#endif
return -1;
Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog (revision 13149)
+++ ruby_1_8_6/ChangeLog (revision 13150)
@@ -1,3 +1,7 @@
+Wed Aug 22 09:38:43 2007 Nobuyoshi Nakada <nobu@r...>
+
+ * process.c (proc_exec_v, rb_proc_exec): preserve errno.
+
Wed Aug 22 09:00:23 2007 Nobuyoshi Nakada <nobu@r...>
* eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occured
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h (revision 13149)
+++ ruby_1_8_6/version.h (revision 13150)
@@ -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
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml