From: Ben Gras Date: Thu, 2 Apr 2009 11:44:26 +0000 (+0000) Subject: don't make susp_count negative. X-Git-Tag: v3.1.4~82 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=73ee8b8b998e7a389ecd68b9780be3084c146885;p=minix.git don't make susp_count negative. --- diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index 82ece30f1..4e3e4dac7 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -352,13 +352,15 @@ int count; /* max number of processes to release */ } /* Search the proc table. */ - for (rp = &fproc[0]; rp < &fproc[NR_PROCS]; rp++) { + for (rp = &fproc[0]; rp < &fproc[NR_PROCS] && count > 0; rp++) { if (rp->fp_pid != PID_FREE && rp->fp_suspended == SUSPENDED && rp->fp_revived == NOT_REVIVING && (rp->fp_fd & BYTE) == call_nr && rp->fp_filp[rp->fp_fd>>8]->filp_vno == vp) { revive(rp->fp_endpoint, 0); susp_count--; /* keep track of who is suspended */ + if(susp_count < 0) + panic("vfs", "susp_count now negative", susp_count); if (--count == 0) return; } }