summaryrefslogtreecommitdiff
path: root/usr.bin/cu
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-07-12 13:50:03 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-07-12 13:50:03 +0000
commit46129a16d94923563a3f45498d176163133ed047 (patch)
treed0ebb41b5ca9730d966c18588bb4d4a04287f188 /usr.bin/cu
parent4eab70b60f5f999f174aebe7ecf2e6bd10d008c4 (diff)
Add handler for SIGHUP.
Diffstat (limited to 'usr.bin/cu')
-rw-r--r--usr.bin/cu/cu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/cu/cu.c b/usr.bin/cu/cu.c
index 9695e126fef..4b5103ae93c 100644
--- a/usr.bin/cu/cu.c
+++ b/usr.bin/cu/cu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cu.c,v 1.7 2012/07/10 13:00:09 nicm Exp $ */
+/* $OpenBSD: cu.c,v 1.8 2012/07/12 13:50:02 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@openbsd.org>
@@ -43,6 +43,7 @@ struct bufferevent *output_ev;
int line_fd;
struct bufferevent *line_ev;
struct event sigterm_ev;
+struct event sighup_ev;
enum {
STATE_NONE,
STATE_NEWLINE,
@@ -143,6 +144,8 @@ getopt:
signal_set(&sigterm_ev, SIGTERM, signal_event, NULL);
signal_add(&sigterm_ev, NULL);
+ signal_set(&sighup_ev, SIGHUP, signal_event, NULL);
+ signal_add(&sighup_ev, NULL);
if (signal(SIGINT, SIG_IGN) == SIG_ERR)
err(1, "signal");
if (signal(SIGQUIT, SIG_IGN) == SIG_ERR)