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@12626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
49ea07f8fc
commit
66169822de
2 changed files with 9 additions and 2 deletions
|
|
@ -1,3 +1,7 @@
|
|||
Tue Jun 26 16:33:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* process.c (proc_exec_v, rb_proc_exec): preserve errno.
|
||||
|
||||
Sat Jun 23 00:37:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* hash.c (rb_hash_select): remove unnecessary varargs for
|
||||
|
|
|
|||
|
|
@ -110,6 +110,9 @@ static VALUE S_Tms;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#define preserving_errno(stmts) \
|
||||
do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
|
@ -982,7 +985,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;
|
||||
}
|
||||
|
||||
|
|
@ -1051,7 +1054,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue