9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] minor bug in dd + fix
@ 2002-05-26 23:07 Mike Haertel
  0 siblings, 0 replies; only message in thread
From: Mike Haertel @ 2002-05-26 23:07 UTC (permalink / raw)
  To: 9fans

While looking into the disk/format bug, I noticed that dd is
printing incorrect counts of blocks written.  The reason is
that it is incrementing the count of blocks written before it
actually checks to see if the write succeeded.

Here's a fix:
term% diff dd.c.old dd.c
293,295d292
< 		if(obc == obs)
< 			nofr++; else
< 			nopr++;
297a295,296
> 			if (c > 0)
> 				++nopr;
300a300,303
> 		if(obc == obs)
> 			nofr++;
> 		else
> 			nopr++;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-26 23:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-26 23:07 [9fans] minor bug in dd + fix Mike Haertel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).