summaryrefslogtreecommitdiff
path: root/master.c
diff options
context:
space:
mode:
Diffstat (limited to 'master.c')
-rw-r--r--master.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/master.c b/master.c
index d5da2c3..3755f65 100644
--- a/master.c
+++ b/master.c
@@ -134,7 +134,7 @@ init_pty(char **argv, int statusfd)
printf("%s: could not execute %s: %s\r\n", progname,
*argv, strerror(errno));
fflush(stdout);
- _exit(127);
+ _exit(1);
}
/* Parent.. Finish up and return */
#ifdef BROKEN_MASTER
@@ -261,7 +261,16 @@ pty_activity(int s)
/* Error -> die */
if (len <= 0)
+ {
+ int status;
+
+ if (wait(&status) >= 0)
+ {
+ if (WIFEXITED(status))
+ exit(WEXITSTATUS(status));
+ }
exit(1);
+ }
#ifdef BROKEN_MASTER
/* Get the current terminal settings. */