4.2bsd dump 2X speedup BUG +FIX
Don Speck
speck at cit-vax.ARPA
Tue Mar 12 20:11:09 AEST 1985
Shortly after I posted my concurrent version of dumptape.c,
wallen at nprdc.arpa reported it bombing with a message
" DUMP: pipe error in command to slave...".
The concurrent dump was treating a short read on a pipe as an
error, when it really isn't.
The belated fix follows. It has been in use 2 weeks on our
(lightly-loaded) VAX/780 with TU77, and as rdump on a 750. Since
we weren't getting short reads anyway, my testing proves nothing;
but I'm much too busy to try forcing the bug to manifest itself.
A better test will be when we get our CDC 92185 in a few weeks.
Don Speck
P.S. We're looking for a competent, non-autocratic person to
tend our 4.2bsd vaxen & Suns, a dozen now and more later...
diff dist/dumptape.c dumptape.c
347a348,357
> readpipe(fd,buf,count) int fd, count; char *buf; {
> int i, n;
> for (n=0; n<count; buf+=i, n+=i)
> if ((i=read(fd,buf,count-n)) <= 0) {
> if (i==0 && n==0) return(0); /* Normal EOF */
> senderr();
> }
> return(n);
> }
>
361c371
< while (read(cmd, req, reqsiz) == reqsiz) {
---
> while (readpipe(cmd, req, reqsiz) > 0) {
370c380
< if (read(cmd,tblock[trecno],TP_BSIZE)!=TP_BSIZE)
---
> if (readpipe(cmd,tblock[trecno],TP_BSIZE) <= 0)
More information about the Comp.unix.wizards
mailing list