X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=Kill.c;h=0a2763eaa20615940a035ce4d7e2b3be8bd2a222;hp=dc6baa159aa8e44e9be93839b01c985fd526478e;hb=3b0896f89988923c314cfb07454dde23b1b401fc;hpb=05697ec1e26eadc2f814d9f84f8c783fff5b98b5 diff --git a/Kill.c b/Kill.c index dc6baa15..0a2763ea 100644 --- a/Kill.c +++ b/Kill.c @@ -41,10 +41,9 @@ int Kill(char *dev, int force, int quiet) * Definitely not safe. */ - void *super; int fd, rv = 0; struct supertype *st; - + fd = open(dev, O_RDWR|O_EXCL); if (fd < 0) { if (!quiet) @@ -60,15 +59,15 @@ int Kill(char *dev, int force, int quiet) close(fd); return 1; } - rv = st->ss->load_super(st, fd, &super, dev); + rv = st->ss->load_super(st, fd, dev); if (force && rv >= 2) rv = 0; /* ignore bad data in superblock */ if (rv== 0 || (force && rv >= 2)) { mdu_array_info_t info; info.major_version = -1; /* zero superblock */ - free(super); - st->ss->init_super(st, &super, &info, 0, "", NULL); - if (st->ss->store_super(st, fd, super)) { + st->ss->free_super(st); + st->ss->init_super(st, &info, 0, "", NULL, NULL); + if (st->ss->store_super(st, fd)) { if (!quiet) fprintf(stderr, Name ": Could not zero superblock on %s\n", dev);