Apparently SIGCHLD is blocked by default in processes run in a
[sgt/putty] / unix / pty.c
index b621d8b..b9bd510 100644 (file)
@@ -474,6 +474,8 @@ int pty_select_result(int fd, int event)
 #endif
            from_backend(pty_frontend, 0, message, strlen(message));
        }
+
+       notify_remote_exit(pty_frontend);
     }
     return !finished;
 }
@@ -619,10 +621,18 @@ static const char *pty_init(void *frontend, void **backend_handle, Config *cfg,
        /*
         * SIGINT and SIGQUIT may have been set to ignored by our
         * parent, particularly by things like sh -c 'pterm &' and
-        * some window managers. Reverse this for our child process.
+        * some window managers. SIGCHLD, meanwhile, has been
+        * tinkered with by the watchdog process. Reverse all this
+        * for our child process.
         */
        putty_signal(SIGINT, SIG_DFL);
        putty_signal(SIGQUIT, SIG_DFL);
+       {
+           sigset_t set;
+           sigemptyset(&set);
+           sigaddset(&set, SIGCHLD);
+           sigprocmask(SIG_UNBLOCK, &set, NULL);
+       }
        if (pty_argv)
            execvp(pty_argv[0], pty_argv);
        else {