summaryrefslogtreecommitdiffstats
path: root/Kill.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-04-04 08:02:49 +0200
committerNeil Brown <neilb@suse.de>2005-04-04 08:02:49 +0200
commitd7eaf49f65ecb99e24255026331b0af7a9245cc2 (patch)
tree1a360f741fc0698f0d766a386eab68ee3b94ee65 /Kill.c
parentFix "--config=partitions" which was broken. (diff)
downloadmdadm-d7eaf49f65ecb99e24255026331b0af7a9245cc2.tar.xz
mdadm-d7eaf49f65ecb99e24255026331b0af7a9245cc2.zip
Use O_EXCL when opening component devices to be assembled into an array
In 2.6, this will fail if the device is already in use, so we can detect this error more easily. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'Kill.c')
-rw-r--r--Kill.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kill.c b/Kill.c
index a57bdf8e..9441f73b 100644
--- 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);