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
c3b878a8c6
commit
c8203bd856
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154858
@ -43,6 +43,7 @@
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
@ -279,6 +280,14 @@ disk_OS_get_ATA_disks(void)
|
|||||||
strlen(found->dev_name)) != 0)
|
strlen(found->dev_name)) != 0)
|
||||||
continue;
|
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 */
|
/* First get the entry from the hrDeviceTbl */
|
||||||
entry = map->entry_p;
|
entry = map->entry_p;
|
||||||
entry->type = OIDX_hrDeviceDiskStorage_c;
|
entry->type = OIDX_hrDeviceDiskStorage_c;
|
||||||
|
Loading…
Reference in New Issue
Block a user