commit - 015cf88c119f8ae946b9e67a190068c02fd4cf1a
commit + 7c124f72cd02e464744bc2a37482328cd239b56a
blob - dd47e956bbf23711f83c825a59582f4ab1389c2c
blob + 2cedfc9a96f3de484aa1b3bbab66a3d174c46465
--- shreddisk.c
+++ shreddisk.c
if (pledge("stdio unveil", NULL) == -1)
err(1, "pledge");
- if (unveil(realdev, "rw") != 0)
+ if (unveil(realdev, "w") != 0)
err(1, "unveil");
/* disable the cursor */
}
written = fwrite(&rnum, BYTES, 1, dd);
if (written != 1 && sizeof(rnum) != written * BYTES)
- err(1, "fwrite");
+ break;
total += (written * BYTES);
now = seconds;
sh_time = time(NULL);
if (round(percent) < 100)
- printf("\n\nDisk appears to have been removed.");
+ printf("\n\nDisk removed or a write error occurred.");
printf("\n\nFinished shredding %s\n", ctime(&sh_time));