summaryrefslogtreecommitdiffstats
path: root/lib/pty-session.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
commitc61e14d3a8412cd50d98aab604e607692c844c8a (patch)
tree4925aca0e6b64c8664ea2f3fdfa99a52dc93d5da /lib/pty-session.c
parentAdding upstream version 2.39.3. (diff)
downloadutil-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.tar.xz
util-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.zip
Adding upstream version 2.40.upstream/2.40
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/pty-session.c')
-rw-r--r--lib/pty-session.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pty-session.c b/lib/pty-session.c
index 3849065..815264d 100644
--- a/lib/pty-session.c
+++ b/lib/pty-session.c
@@ -241,6 +241,7 @@ int ul_pty_signals_setup(struct ul_pty *pty)
sigaddset(&ourset, SIGCHLD);
sigaddset(&ourset, SIGWINCH);
sigaddset(&ourset, SIGALRM);
+ sigaddset(&ourset, SIGHUP);
sigaddset(&ourset, SIGTERM);
sigaddset(&ourset, SIGINT);
sigaddset(&ourset, SIGQUIT);
@@ -584,6 +585,8 @@ static int handle_signal(struct ul_pty *pty, int fd)
&info, (void *) &pty->win);
}
break;
+ case SIGHUP:
+ /* fallthrough */
case SIGTERM:
/* fallthrough */
case SIGINT:
@@ -641,7 +644,7 @@ int ul_pty_proxy_master(struct ul_pty *pty)
/* note, callback usually updates @next_callback_time */
if (timerisset(&pty->next_callback_time)) {
- struct timeval now;
+ struct timeval now = { 0 };;
DBG(IO, ul_debugobj(pty, " callback requested"));
gettime_monotonic(&now);
@@ -654,7 +657,7 @@ int ul_pty_proxy_master(struct ul_pty *pty)
/* set timeout */
if (timerisset(&pty->next_callback_time)) {
- struct timeval now, rest;
+ struct timeval now = { 0 }, rest = { 0 };
gettime_monotonic(&now);
timersub(&pty->next_callback_time, &now, &rest);