=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/aucat/Attic/file.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/usr.bin/aucat/Attic/file.c 2010/04/03 17:40:33 1.16 +++ src/usr.bin/aucat/Attic/file.c 2010/04/03 17:59:17 1.17 @@ -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 * @@ -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 @@ 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 @@ 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) {