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

ext/pty/pty.c: status to protect

* ext/pty/pty.c (establishShell): now needs status to protect from
  exceptions in rb_fork_err().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-06-08 02:25:55 +00:00
parent 193681fb3b
commit bc81a19e99
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Jun 8 11:25:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/pty.c (establishShell): now needs status to protect from
exceptions in rb_fork_err().
Thu Jun 7 22:13:05 2012 Tanaka Akira <akr@fsij.org>
* process.c (rb_fork_err): Fix the conditoin to use rb_protect.

View file

@ -155,7 +155,7 @@ static void
establishShell(int argc, VALUE *argv, struct pty_info *info,
char SlaveName[DEVICELEN])
{
int master,slave;
int master, slave, status = 0;
rb_pid_t pid;
char *p, *getenv();
struct passwd *pwent;
@ -189,7 +189,7 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
carg.argc = argc;
carg.argv = argv;
errbuf[0] = '\0';
pid = rb_fork_err(0, chfunc, &carg, Qnil, errbuf, sizeof(errbuf));
pid = rb_fork_err(&status, chfunc, &carg, Qnil, errbuf, sizeof(errbuf));
if (pid < 0) {
int e = errno;