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:
parent
be52ac2832
commit
0dafc47595
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user