summaryrefslogtreecommitdiff
path: root/ext/pty/pty.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-08 02:25:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-08 02:25:55 +0000
commitbc81a19e99ab99d4a1d8e4cedce3fbf87c52bda4 (patch)
treef6a16ef11eef7382c5f1e0dda87e8067a7037cea /ext/pty/pty.c
parent193681fb3bed526f4701393bc2e7eccb7c7a3728 (diff)
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
Diffstat (limited to 'ext/pty/pty.c')
-rw-r--r--ext/pty/pty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 06d4075..be87c37 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -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;