=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/job.c,v retrieving revision 1.61 retrieving revision 1.62 diff -c -r1.61 -r1.62 *** src/usr.bin/make/job.c 2007/03/02 04:32:32 1.61 --- src/usr.bin/make/job.c 2007/06/12 16:33:27 1.62 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: job.c,v 1.61 2007/03/02 04:32:32 ray Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: job.c,v 1.62 2007/06/12 16:33:27 cnst Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* *************** *** 1349,1362 **** job->curPos = 0; if (outputsp == NULL || job->inPipe > outputsn) { ! int bytes = howmany(job->inPipe+1, NFDBITS) * sizeof(fd_mask); ! int obytes = howmany(outputsn+1, NFDBITS) * sizeof(fd_mask); ! if (outputsp == NULL || obytes != bytes) { ! outputsp = realloc(outputsp, bytes); ! if (outputsp == NULL) return; ! memset(outputsp + obytes, 0, bytes - obytes); } outputsn = job->inPipe; } --- 1349,1367 ---- job->curPos = 0; if (outputsp == NULL || job->inPipe > outputsn) { ! int bytes, obytes; ! char *tmp; ! bytes = howmany(job->inPipe+1, NFDBITS) * sizeof(fd_mask); ! obytes = outputsn ? ! howmany(outputsn+1, NFDBITS) * sizeof(fd_mask) : 0; ! ! if (bytes != obytes) { ! tmp = realloc(outputsp, bytes); ! if (tmp == NULL) return; ! memset(tmp + obytes, 0, bytes - obytes); ! outputsp = (fd_set *)tmp; } outputsn = job->inPipe; }