1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
shyouhei 2007-08-22 00:39:04 +00:00
parent 4357f31d25
commit 5de33d8fa3
3 changed files with 10 additions and 3 deletions

View file

@ -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

View file

@ -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;

View file

@ -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