-/* $OpenBSD: softraid.c,v 1.7 2022/11/08 12:08:53 kn Exp $ */
+/* $OpenBSD: softraid.c,v 1.8 2022/11/08 14:05:41 kn Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
*
if (ioctl(devfd, BIOCDISK, bd) == -1)
err(1, "BIOCDISK");
+ /* Keydisks always have a size of zero. */
+ if (bd->bd_size == 0)
+ return -1;
+
/* Check disk status. */
if (bd->bd_status != BIOC_SDONLINE &&
bd->bd_status != BIOC_SDREBUILD) {
return -1;
}
- /* Keydisks always have a size of zero. */
- if (bd->bd_size == 0) {
- fprintf(stderr, "softraid chunk %u is keydisk - skipping...\n",
- disk);
- return -1;
- }
-
if (strlen(bd->bd_vendor) < 1)
errx(1, "invalid disk name");
*part = bd->bd_vendor[strlen(bd->bd_vendor) - 1];