]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wipefs: use O_EXCL
authorKarel Zak <kzak@redhat.com>
Mon, 15 Oct 2012 10:38:09 +0000 (12:38 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Oct 2012 10:38:09 +0000 (12:38 +0200)
Address: https://bugzilla.redhat.com/show_bug.cgi?id=865961
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/wipefs.c

index cddad8a0e3c3d85e95bf51f220b8ea14bfa40017..0ddc148d023d818cc63443b58dc5c02979ef0eb5 100644 (file)
@@ -309,7 +309,7 @@ static void do_wipe_real(blkid_probe pr, const char *devname, struct wipe_desc *
 static struct wipe_desc *
 do_wipe(struct wipe_desc *wp, const char *devname, int noact, int all, int quiet)
 {
-       blkid_probe pr = new_probe(devname, O_RDWR);
+       blkid_probe pr = new_probe(devname, O_RDWR | O_EXCL);
        struct wipe_desc *w, *wp0 = clone_offset(wp);
        int zap = all ? 1 : wp->zap;