X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=Kill.c;fp=Kill.c;h=e73897857dd15df767f8975fb841664ad74d964d;hp=63442a628313b5dce794455c9a17220c2435b34d;hb=4c619b292f7e6b69a817b96d2001ff8f10b7a6bd;hpb=fc7e81e54ec37ece4f1a8ec1729933fc22ec25ff diff --git a/Kill.c b/Kill.c index 63442a62..e7389785 100644 --- a/Kill.c +++ b/Kill.c @@ -34,6 +34,10 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl) /* * Nothing fancy about Kill. It just zeroes out a superblock * Definitely not safe. + * Returns: + * 0 - a zero superblock was successfully written out + * 1 - failed to write the zero superblock + * 2 - failed to open the device or find a superblock. */ int fd, rv = 0; @@ -45,8 +49,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl) if (!quiet) fprintf(stderr, Name ": Couldn't open %s for write - not zeroing\n", dev); - close(fd); - return 1; + return 2; } if (st == NULL) st = guess_super(fd);