From abe211d70d9d3509c264f20389684e98e146f7be Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Mon, 16 Dec 2002 21:53:48 +0000 Subject: use the kudzu api properly. if devices is NULL, there aren't any disks --- loader2/modules.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'loader2/modules.c') diff --git a/loader2/modules.c b/loader2/modules.c index f640bacd9..38c2bce50 100644 --- a/loader2/modules.c +++ b/loader2/modules.c @@ -88,12 +88,14 @@ static int scsiCount(void) { static int scsiDiskCount(void) { - struct device ** devices, ** device; + struct device ** devices; int i = 0; devices = probeDevices(CLASS_HD, BUS_SCSI, PROBE_ALL); + if (!devices) + return 0; - for (device = devices; *device; device++) i++; + for (i = 0; devices[i]; i++); return i; } @@ -318,7 +320,6 @@ static int loadModule(const char * modName, struct extractedModule * path, modLoaded->mods[num].major = DRIVER_NONE; modLoaded->mods[num].minor = DRIVER_MINOR_NONE; } - if (args) { for (i=0, arg = args; *arg; arg++, i++); newArgs = malloc(sizeof(*newArgs) * (i + 1)); -- cgit