Skip to content

Commit

Permalink
Integrate review ideas from Tim Mann.
Browse files Browse the repository at this point in the history
  • Loading branch information
qbarnes committed Mar 11, 2024
1 parent 731f3df commit e248fc2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cw2dmk.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,18 @@ dmk_write_header(void)


void
dmk_write(void)
dmk_write(int min_sector_cnt)
{
int i;

if (accum_sectors)
good_sectors += reused_sectors;

msg(OUT_TSUMMARY, " %d good sector%s", good_sectors, plu(good_sectors));
if (min_sector_cnt && (good_sectors != min_sector_cnt))
msg(OUT_TSUMMARY, " %d/%d", good_sectors, min_sector_cnt);
else
msg(OUT_TSUMMARY, " %d", good_sectors);
msg(OUT_TSUMMARY, " good sector%s", plu(good_sectors));
if (accum_sectors && reused_sectors > 0)
msg(OUT_TSUMMARY, " (%d reused)", reused_sectors);
msg(OUT_TSUMMARY, ", %d error%s\n", errcount, plu(errcount));
Expand Down Expand Up @@ -2491,13 +2495,14 @@ main(int argc, char** argv)
}

failing = ((accum_sectors ? merged_stat.errcount : errcount) > 0 ||
retry < min_retries[track][side] ||
retry < min_retries[track][side] ||
good_sectors < min_sectors[track][side])
&& (replay || retry < retries[track][side]);

// Generally just reporting on the latest read.
if (failing) {
if (good_sectors < min_sectors[track][side])
if (min_sectors[track][side] &&
(good_sectors != min_sectors[track][side]))
msg(OUT_TSUMMARY, "[%d/%d", good_sectors, min_sectors[track][side]);
else
msg(OUT_TSUMMARY, "[%d", good_sectors);
Expand Down Expand Up @@ -2546,7 +2551,7 @@ main(int argc, char** argv)
memcpy(enc_count, merged_stat.enc_count, sizeof enc_count);
memcpy(enc_sec, merged_stat.enc_sec, sizeof enc_sec);
}
dmk_write();
dmk_write(min_sectors[track][side]);
}
track_done:;
}
Expand Down
5 changes: 5 additions & 0 deletions cw2dmk.man
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ entirely missed.
The \fImin_sectors\fP argument can be just a number or optionally a
comma-separated list of track ranges. See section List of Tracks
and Sides for more information.

If more or less sectors are encountered during a track read than are
anticipated by this option, a fractional sector number is reported
with the denominator being the minimum sector value for that track's
read (e.g. "9/10" or "19/18").
.TP
.B \-x \fImax_retry\fP
While reading a track, cw2dmk tries to recognize sector IDs and sector
Expand Down

0 comments on commit e248fc2

Please sign in to comment.