summaryrefslogtreecommitdiff
path: root/lib/libsndio/aucat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libsndio/aucat.c')
-rw-r--r--lib/libsndio/aucat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index e7be5694107..4a9919825a2 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.25 2009/08/26 05:33:01 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.26 2009/08/28 06:37:06 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -271,6 +271,12 @@ aucat_close(struct sio_hdl *sh)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
+ if (!hdl->sio.eof) {
+ AMSG_INIT(&hdl->wmsg);
+ hdl->wmsg.cmd = AMSG_BYE;
+ hdl->wtodo = sizeof(struct amsg);
+ (void)aucat_wmsg(hdl);
+ }
while (close(hdl->fd) < 0 && errno == EINTR)
; /* nothing */
free(hdl);