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 a57bdf8..9441f73 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);