aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-04 18:49:28 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-04 18:49:28 +0000
commit56d53ec2a1874455bfb26fc1c9dc2b23a30b91aa (patch)
tree7a5a7bf930543be18c4fbe2bdec6d9ff58759032
parentterm: set 'is_shutting_down' before calling term_destroy() on error (diff)
term: don't register ptmx with FDM if we're shutting down
This can happen when there's an error instantiating the terminal *after* we've spawned the slave process.
-rw-r--r--terminal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/terminal.c b/terminal.c
index 35ad71c0..44046f1c 100644
--- a/terminal.c
+++ b/terminal.c
@@ -957,8 +957,10 @@ void
term_window_configured(struct terminal *term)
{
/* Enable ptmx FDM callback */
- assert(term->window->is_configured);
- fdm_add(term->fdm, term->ptmx, EPOLLIN, &fdm_ptmx, term);
+ if (!term->is_shutting_down) {
+ assert(term->window->is_configured);
+ fdm_add(term->fdm, term->ptmx, EPOLLIN, &fdm_ptmx, term);
+ }
}
static bool