+ err(EX_NOINPUT, "open(%s) failed", file);
+
+ if (!quiet) {
+ pid_t pid;
+ const char *argv[] = {"fdisk", "-l", file, NULL};
+ if (posix_spawnp(&pid, argv[0], NULL, NULL, (char *const *)argv, NULL))
+ err(EX_OSERR, "spawn(%s %s) failed", argv[0], file);
+ waitpid(pid, NULL, 0);
+ printf("\n");
+ }
+
+ if (!yes) {
+ printf("Do you want to wipe '%s'? (y/N) ", file);
+ fflush(stdout);
+ char c = 0;
+ if (fread(&c, 1, 1, stdin)) {/* don't care */}
+ if (tolower(c) != 'y')
+ errx(EX_UNAVAILABLE, "User decided not to wipe");
+ }