]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/pty: reset mainloop timeout on signal
authorKarel Zak <kzak@redhat.com>
Wed, 31 Jul 2019 09:57:26 +0000 (11:57 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Oct 2019 11:11:54 +0000 (13:11 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/pty-session.c

index 709c55bb70353b6dd116f8be57b8be56c9255e16..4776c26dfc76643139278d2f5948eb7bd6316da7 100644 (file)
@@ -330,8 +330,10 @@ static int handle_signal(struct ul_pty *pty, int fd)
                else if (info.ssi_status == SIGSTOP && pty->child > 0)
                        pty->callbacks.child_sigstop(pty->callback_data);
 
-               if (pty->child <= 0)
+               if (pty->child <= 0) {
                        pty->poll_timeout = 10;
+                       timerclear(&pty->next_callback_time);
+               }
                return 0;
        case SIGWINCH:
                DBG(SIG, ul_debugobj(pty, " get signal SIGWINCH"));
@@ -451,7 +453,7 @@ int ul_pty_proxy_master(struct ul_pty *pty)
                        } else
                                rc = 0;
 
-                       DBG(IO, ul_debugobj(pty, "leaving poll() loop [timeout=%d, rc=%d]", pty->poll_timeout, rc));
+                       DBG(IO, ul_debugobj(pty, "leaving poll() loop [timeout=%d, rc=%d]", timeout, rc));
                        break;
                }
                /* event */