summaryrefslogtreecommitdiffstats
path: root/spawn.c
diff options
context:
space:
mode:
authornicm <nicm>2019-09-18 11:37:58 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2019-09-25 15:56:53 +0100
commitf0712a7569c4a14276567bad123e18214c9137db (patch)
tree516ec84db5c85650f2558cb5afeed0cde844927a /spawn.c
parent9d1cecea8ef4ddafc666e0d3dcad4fae21170be8 (diff)
Do not set uninitialized signal mask when creating an empty pane.
Diffstat (limited to 'spawn.c')
-rw-r--r--spawn.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/spawn.c b/spawn.c
index 2a588b6b..b8397b75 100644
--- a/spawn.c
+++ b/spawn.c
@@ -330,14 +330,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);
@@ -347,6 +339,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) {