=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/aucat/Attic/aproc.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- src/usr.bin/aucat/Attic/aproc.c 2010/04/24 06:18:23 1.54 +++ src/usr.bin/aucat/Attic/aproc.c 2010/04/24 13:32:21 1.55 @@ -1,4 +1,4 @@ -/* $OpenBSD: aproc.c,v 1.54 2010/04/24 06:18:23 ratchov Exp $ */ +/* $OpenBSD: aproc.c,v 1.55 2010/04/24 13:32:21 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -854,6 +854,7 @@ maxwrite = p->u.mix.maxlat - p->u.mix.lat; mix_bzero(obuf); scount = 0; + /* XXX: can obuf->len be larger than obuf->w.mix.todo ? */ odone = obuf->len; for (i = LIST_FIRST(&p->ins); i != NULL; i = inext) { inext = LIST_NEXT(i, ient); @@ -878,7 +879,6 @@ if (!(p->flags & APROC_DROP)) return 0; odone = obuf->w.mix.todo; - p->u.mix.idle += odone; } if (maxwrite > 0) { if (odone > maxwrite) @@ -893,6 +893,8 @@ if (APROC_OK(p->u.mix.mon)) mon_snoop(p->u.mix.mon, obuf, obuf->used - odone, odone); } + if (LIST_EMPTY(&p->ins)) + p->u.mix.idle += odone; if (scount == 0) return 0; return 1;