Fix false positives when searching for disks. Things like adv(4) are not

disks.

Submitted by:	Victor Cruceru <soc-victor@>
This commit is contained in:
harti 2006-01-26 11:49:27 +00:00
parent be52ac2832
commit 0dafc47595

View File

@ -43,6 +43,7 @@
#include <sys/sysctl.h>
#include <assert.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <paths.h>
@ -279,6 +280,14 @@ disk_OS_get_ATA_disks(void)
strlen(found->dev_name)) != 0)
continue;
/*
* Avoid false disk devices. For example adw(4) and
* adv(4) - they are not disks!
*/
if (strlen(map->name_key) > strlen(found->dev_name) &&
!isdigit(map->name_key[strlen(found->dev_name)]))
continue;
/* First get the entry from the hrDeviceTbl */
entry = map->entry_p;
entry->type = OIDX_hrDeviceDiskStorage_c;