]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Kill.c
Use O_EXCL when opening component devices to be assembled into an array
[thirdparty/mdadm.git] / Kill.c
diff --git a/Kill.c b/Kill.c
index a57bdf8e484e4f1cd63f7cd927962eb865556bf0..9441f73bb43f88ce4733ac7671e7c2cfc9dd94ab 100644 (file)
--- a/Kill.c
+++ b/Kill.c
@@ -44,7 +44,7 @@ int Kill(char *dev, int force)
        mdp_super_t super;
        int fd, rv = 0;
                
-       fd = open(dev, O_RDWR);
+       fd = open(dev, O_RDWR|O_EXCL);
        if (fd < 0) {
                fprintf(stderr, Name ": Couldn't open %s for write - not zeroing\n",
                        dev);