Update to match the progress interface on blank command.

This commit is contained in:
Søren Schmidt 2000-12-26 11:56:15 +00:00
parent dec35f9164
commit e3b9882dc4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=70362

View File

@ -35,6 +35,7 @@
#include <err.h>
#include <sysexits.h>
#include <fcntl.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/cdio.h>
@ -121,10 +122,24 @@ main(int argc, char **argv)
break;
}
if (!strcmp(argv[arg], "blank")) {
int error, percent;
if (!quiet)
fprintf(stderr, "blanking CD, please wait..\n");
fprintf(stderr, "blanking CD, please wait..\r");
if (ioctl(fd, CDRIOCBLANK) < 0)
err(EX_IOERR, "ioctl(CDRIOCBLANK)");
while (1) {
sleep(1);
error = ioctl(fd, CDRIOCGETPROGRESS, &percent);
if (percent > 0 && !quiet)
fprintf(stderr,
"blanking CD - %d %% done"
" \r",
percent);
if (error || percent == 100)
break;
}
if (!quiet)
printf("\n");
continue;
}
if (!strcmp(argv[arg], "audio") || !strcmp(argv[arg], "raw")) {