X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=Kill.c;h=f5c582180ac28d7a8593657f42b02d481aa352be;hb=0d5a423fe7481de5ce20c6174841afeb1aadd255;hp=d5c1e36df4d3724e6cf060238902cb897e01bfed;hpb=5a52a340905d1a9d0a268ce2621f55db6b3fd423;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",