diff options
author | 2008-11-16 21:16:08 +0000 | |
---|---|---|
committer | 2008-11-16 21:16:08 +0000 | |
commit | beb2acbb45a1faa5888edf513d378f92c0622298 (patch) | |
tree | 9a44f836feb33df673491c66397cca3b325fa760 | |
parent | aucat stops the device when idle, remove the corresponding (diff) | |
download | wireguard-openbsd-beb2acbb45a1faa5888edf513d378f92c0622298.tar.xz wireguard-openbsd-beb2acbb45a1faa5888edf513d378f92c0622298.zip |
trigger rproc->eof() and and wproc->hup() if POLLHUP event is set.
Fixes aucat sleeping forever when the devices disappears
-rw-r--r-- | usr.bin/aucat/file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/aucat/file.c b/usr.bin/aucat/file.c index 18da0f25d94..fdca8f99300 100644 --- a/usr.bin/aucat/file.c +++ b/usr.bin/aucat/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.6 2008/11/16 17:08:32 ratchov Exp $ */ +/* $OpenBSD: file.c,v 1.7 2008/11/16 21:16:08 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -187,6 +187,10 @@ file_poll(void) break; } } + if (!(f->state & FILE_ZOMB) && (revents & POLLHUP)) { + DPRINTFN(2, "file_poll: %s: disconnected\n", f->name); + f->state |= (FILE_EOF | FILE_HUP); + } if (!(f->state & FILE_ZOMB) && (f->state & FILE_EOF)) { DPRINTFN(2, "file_poll: %s: eof\n", f->name); p = f->rproc; |