diff options
author | Neil Brown <neilb@suse.de> | 2005-04-04 08:02:49 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-04-04 08:02:49 +0200 |
commit | d7eaf49f65ecb99e24255026331b0af7a9245cc2 (patch) | |
tree | 1a360f741fc0698f0d766a386eab68ee3b94ee65 /Kill.c | |
parent | Fix "--config=partitions" which was broken. (diff) | |
download | mdadm-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |