version 1.16, 2006/08/28 02:36:43 |
version 1.17, 2007/07/31 21:21:11 |
|
|
again: |
again: |
r = ioctl(fd, SCIOCCOMMAND, &scr); |
r = ioctl(fd, SCIOCCOMMAND, &scr); |
if (r != 0) { |
if (r != 0) { |
printf("%60s\r", ""); |
printf("\r%60s", ""); |
warn("ioctl failed while attempting to write"); |
warn("ioctl failed while attempting to write"); |
return (-1); |
return (-1); |
} |
} |
|
|
goto again; |
goto again; |
} |
} |
if (scr.retsts != SCCMD_OK) { |
if (scr.retsts != SCCMD_OK) { |
printf("%60s\r", ""); |
printf("\r%60s", ""); |
warnx("ioctl returned bad status while " |
warnx("ioctl returned bad status while " |
"attempting to write: %d", |
"attempting to write: %d", |
scr.retsts); |
scr.retsts); |
|
|
gettimeofday(&tv, NULL); |
gettimeofday(&tv, NULL); |
if (lba == end_lba || timercmp(&tv, &otv, >)) { |
if (lba == end_lba || timercmp(&tv, &otv, >)) { |
fprintf(stderr, |
fprintf(stderr, |
"track %02d '%c' %08u/%08u %3d%%\r", |
"\rtrack %02d '%c' %08u/%08u %3d%%", |
track, tr->type, |
track, tr->type, |
lba, end_lba, 100 * lba / end_lba); |
lba, end_lba, 100 * lba / end_lba); |
timeradd(&tv, &atv, &otv); |
timeradd(&tv, &atv, &otv); |