term: ptmx pause/resume: don't modify the FDM if ptmx has been closed

This fixes error message spam when resizing a terminal window executed
with --hold, and where the client application has terminated.
This commit is contained in:
Daniel Eklöf 2025-02-05 11:39:06 +01:00
parent 6f9129fa3a
commit 2fe72effa9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -387,12 +387,16 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
bool
term_ptmx_pause(struct terminal *term)
{
if (term->ptmx < 0)
return false;
return fdm_event_del(term->fdm, term->ptmx, EPOLLIN);
}
bool
term_ptmx_resume(struct terminal *term)
{
if (term->ptmx < 0)
return false;
return fdm_event_add(term->fdm, term->ptmx, EPOLLIN);
}