summaryrefslogtreecommitdiffstats
path: root/lib/pty-session.c
diff options
context:
space:
mode:
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);