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:
Hartmut Brandt 2006-01-26 11:49:27 +00:00
parent c3b878a8c6
commit c8203bd856
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154858

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;