From 56d53ec2a1874455bfb26fc1c9dc2b23a30b91aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 4 May 2020 20:49:28 +0200 Subject: [PATCH] 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. --- terminal.c | 6 ++++-- 1 file 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