From 22eba5121632c4b26541fbb04209a90b93c24bcc Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 18 Dec 2008 14:04:45 +1100 Subject: Kill: Don't use O_EXCL when --force is used. We really want --zero-super --force to zero the superblock in all situations. So don't open with O_EXCL - trust the user. Signed-off-by: NeilBrown --- Kill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kill.c') diff --git a/Kill.c b/Kill.c index 0a2763e..b1e19b5 100644 --- a/Kill.c +++ b/Kill.c @@ -44,7 +44,7 @@ int Kill(char *dev, int force, int quiet) int fd, rv = 0; struct supertype *st; - fd = open(dev, O_RDWR|O_EXCL); + fd = open(dev, O_RDWR|(force ? 0 : O_EXCL)); if (fd < 0) { if (!quiet) fprintf(stderr, Name ": Couldn't open %s for write - not zeroing\n", -- cgit v1.2.1