summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/aucat/file.c')
-rw-r--r--usr.bin/aucat/file.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/usr.bin/aucat/file.c b/usr.bin/aucat/file.c
index af37e199fa0..4172325ec10 100644
--- a/usr.bin/aucat/file.c
+++ b/usr.bin/aucat/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.16 2010/04/03 17:40:33 ratchov Exp $ */
+/* $OpenBSD: file.c,v 1.17 2010/04/03 17:59:17 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -63,6 +63,8 @@
#define MAXFDS 100
+extern struct fileops listen_ops, pipe_ops;
+
struct timeval file_tv;
struct filelist file_list;
struct timo *timo_queue;
@@ -518,6 +520,23 @@ filelist_done(void)
timo_done();
}
+/*
+ * Close all listening sockets.
+ *
+ * XXX: remove this
+ */
+void
+filelist_unlisten(void)
+{
+ struct file *f, *fnext;
+
+ for (f = LIST_FIRST(&file_list); f != NULL; f = fnext) {
+ fnext = LIST_NEXT(f, entry);
+ if (f->ops == &listen_ops)
+ file_del(f);
+ }
+}
+
unsigned
file_read(struct file *f, unsigned char *data, unsigned count)
{
@@ -657,8 +676,6 @@ file_close(struct file *f)
dbg_puts(": closing\n");
}
#endif
- if (f->wproc == NULL && f->rproc == NULL)
- f->state |= FILE_ZOMB;
if (!(f->state & (FILE_RINUSE | FILE_WINUSE))) {
p = f->rproc;
if (p) {