summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjpsollie <janpieter.sollie@edpnet.be>2021-06-09 15:03:38 +0200
committerKent Overstreet <kent.overstreet@gmail.com>2021-06-13 01:09:56 -0400
commit0fbe294a96bfecf7cb2d1fdb747f5c541f62b47f (patch)
tree65ec0f12c0b87163583611b96a9b3535ac56d01d
parent2be79b428b33a87ec285ea7663844ab5a2bd4807 (diff)
Improve compiler compatibility + run blkid remove for all filesystems
add a blk_wipe function to remove any possible filesystems left on the block device this makes sure the automounter does not accidentally mount it as another filesystem. Signed-off by: Janpieter Sollie <janpieter.sollie@edpnet.be>
-rw-r--r--tools-util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools-util.c b/tools-util.c
index 361419ae..3cc0de44 100644
--- a/tools-util.c
+++ b/tools-util.c
@@ -289,6 +289,8 @@ int open_for_format(const char *dev, bool force)
fputs("Proceed anyway?", stdout);
if (!ask_yn())
exit(EXIT_FAILURE);
+ while (blkid_do_probe(pr) == 0)
+ blkid_do_wipe(pr, 0);
}
blkid_free_probe(pr);