Do not set uninitialized signal mask when creating an empty pane.

pull/1914/head
nicm 2019-09-18 11:37:58 +00:00
parent 83be3afc54
commit 697f938355
1 changed files with 8 additions and 8 deletions

16
spawn.c
View File

@ -332,14 +332,6 @@ spawn_pane(struct spawn_context *sc, char **cause)
cmd_log_argv(new_wp->argc, new_wp->argv, "%s", __func__);
environ_log(child, "%s: environment ", __func__);
/* If the command is empty, don't fork a child process. */
if (sc->flags & SPAWN_EMPTY) {
new_wp->flags |= PANE_EMPTY;
new_wp->base.mode &= ~MODE_CURSOR;
new_wp->base.mode |= MODE_CRLF;
goto complete;
}
/* Initialize the window size. */
memset(&ws, 0, sizeof ws);
ws.ws_col = screen_size_x(&new_wp->base);
@ -349,6 +341,14 @@ spawn_pane(struct spawn_context *sc, char **cause)
sigfillset(&set);
sigprocmask(SIG_BLOCK, &set, &oldset);
/* If the command is empty, don't fork a child process. */
if (sc->flags & SPAWN_EMPTY) {
new_wp->flags |= PANE_EMPTY;
new_wp->base.mode &= ~MODE_CURSOR;
new_wp->base.mode |= MODE_CRLF;
goto complete;
}
/* Fork the new process. */
new_wp->pid = fdforkpty(ptm_fd, &new_wp->fd, new_wp->tty, NULL, &ws);
if (new_wp->pid == -1) {