Index: usr.sbin/burncd/burncd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v retrieving revision 1.45 diff -u -r1.45 burncd.c --- usr.sbin/burncd/burncd.c 13 May 2005 20:06:44 -0000 1.45 +++ usr.sbin/burncd/burncd.c 27 Dec 2006 01:59:40 -0000 @@ -187,7 +189,7 @@ } if ((!strcasecmp(argv[arg], "erase") || !strcasecmp(argv[arg], "blank")) && !test_write) { - int blank, pct, last = 0; + int blank, pct, done = -1, sec = 0; if (!strcasecmp(argv[arg], "erase")) blank = CDR_B_ALL; @@ -199,18 +201,16 @@ if (ioctl(fd, CDRIOCBLANK, &blank) < 0) err(EX_IOERR, "ioctl(CDRIOCBLANK)"); - while (1) { + while (done != 0) { sleep(1); if (ioctl(fd, CDRIOCGETPROGRESS, &pct) == -1) err(EX_IOERR,"ioctl(CDRIOGETPROGRESS)"); - if (pct > 0 && !quiet) + done = ioctl(fd, CDIOCRESET, NULL); + if (!quiet) fprintf(stderr, - "%sing CD - %d %% done \r", + "%sing CD - %3dsec %3d %% done \r", blank == CDR_B_ALL ? - "eras" : "blank", pct); - if (pct == 100 || (pct == 0 && last > 90)) - break; - last = pct; + "eras" : "blank", ++sec, pct); } if (!quiet) printf("\n"); Index: sys/dev/ata/atapi-cd.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/atapi-cd.c,v retrieving revision 1.179.2.7 diff -u -r1.179.2.7 atapi-cd.c --- sys/dev/ata/atapi-cd.c 2 Sep 2006 17:01:32 -0000 1.179.2.7 +++ sys/dev/ata/atapi-cd.c 26 Dec 2006 15:59:37 -0000 @@ -1234,7 +1234,7 @@ request->flags = ATA_R_ATAPI | ATA_R_READ; request->timeout = 30; ata_queue_request(request); - if (!request->error && request->u.atapi.sense.error & ATA_SENSE_VALID) + if (!request->error && request->u.atapi.sense.error) *finished = ((request->u.atapi.sense.specific2 | (request->u.atapi.sense.specific1 << 8)) * 100) / 65535; else