diff options
author | sos <sos@FreeBSD.org> | 2000-12-26 11:56:15 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2000-12-26 11:56:15 +0000 |
commit | 391df2055e2de4a517b02e3a14f985e31572f072 (patch) | |
tree | 780a6844cb25f4eb01d624ebc76dc6fde8d40101 /usr.sbin/burncd | |
parent | d65168d03ee4827064914b90fabefe9f404ec66a (diff) | |
download | FreeBSD-src-391df2055e2de4a517b02e3a14f985e31572f072.zip FreeBSD-src-391df2055e2de4a517b02e3a14f985e31572f072.tar.gz |
Update to match the progress interface on blank command.
Diffstat (limited to 'usr.sbin/burncd')
-rw-r--r-- | usr.sbin/burncd/burncd.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/burncd/burncd.c b/usr.sbin/burncd/burncd.c index 660e28b..e60c21a 100644 --- a/usr.sbin/burncd/burncd.c +++ b/usr.sbin/burncd/burncd.c @@ -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")) { |