X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=Kill.c;h=f5c582180ac28d7a8593657f42b02d481aa352be;hb=df0d4ea04e34fc5d499056b00fa1e0a25f21453e;hp=d5c1e36df4d3724e6cf060238902cb897e01bfed;hpb=750b6fe656e31a3717b52cdaca6a3a90346bcbb8;p=thirdparty%2Fmdadm.git diff --git a/Kill.c b/Kill.c index d5c1e36d..f5c58218 100644 --- a/Kill.c +++ b/Kill.c @@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2006 Neil Brown + * Copyright (C) 2001-2009 Neil Brown * * * This program is free software; you can redistribute it and/or modify @@ -19,12 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Neil Brown - * Email: - * Paper: Neil Brown - * School of Computer Science and Engineering - * The University of New South Wales - * Sydney, 2052 - * Australia + * Email: * * Added by Dale Stephenson * steph@snapserver.com @@ -44,7 +39,9 @@ int Kill(char *dev, int force, int quiet, int noexcl) int fd, rv = 0; struct supertype *st; - fd = open(dev, O_DIRECT | (noexcl ? O_RDWR : (O_RDWR|O_EXCL))); + if (force) + noexcl = 1; + 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",