diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2009-01-23 17:52:14 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2009-01-23 17:52:14 +0000 |
commit | 9a5851d4b30aae599e77ec4538fc8efb635b77cf (patch) | |
tree | a3c6c1fe596f990302114642a9e7b9763886f72b /usr.bin | |
parent | e7ec44c97784df16ba9b9036f6262aa59a3381ab (diff) |
catch SIGHUP and SIGTERM too, to ensure that recorded files are
properly closed and sockets are cleaned up.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/aucat/aucat.1 | 9 | ||||
-rw-r--r-- | usr.bin/aucat/aucat.c | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/aucat/aucat.1 b/usr.bin/aucat/aucat.1 index 9f9462ac56e..490d8640f6f 100644 --- a/usr.bin/aucat/aucat.1 +++ b/usr.bin/aucat/aucat.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: aucat.1,v 1.43 2009/01/10 22:13:07 jmc Exp $ +.\" $OpenBSD: aucat.1,v 1.44 2009/01/23 17:52:13 ratchov Exp $ .\" .\" Copyright (c) 2006 Alexandre Ratchov <alex@caoua.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 10 2009 $ +.Dd $Mdocdate: January 23 2009 $ .Dt AUCAT 1 .Os .Sh NAME @@ -163,7 +163,10 @@ then the stream is closed permanently. If .Nm is sent -.Dv SIGINT , +.Dv SIGHUP , +.Dv SIGINT +or +.Dv SIGTERM , it terminates recording to files. If sent .Dv SIGUSR1 diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 7354603ea72..8de52227369 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.52 2009/01/23 17:38:15 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.53 2009/01/23 17:52:13 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -491,6 +491,10 @@ main(int argc, char **argv) sa.sa_handler = sigint; if (sigaction(SIGINT, &sa, NULL) < 0) DPRINTF("sigaction(int) failed\n"); + if (sigaction(SIGTERM, &sa, NULL) < 0) + DPRINTF("sigaction(term) failed\n"); + if (sigaction(SIGHUP, &sa, NULL) < 0) + DPRINTF("sigaction(hup) failed\n"); #ifdef DEBUG sa.sa_handler = sigusr1; if (sigaction(SIGUSR1, &sa, NULL) < 0) |