Don't race in FreeBSD devstat collector
Querying the number of devices separately from the device list itself is racy. Devices may be added or removed between the two calls; and removed devices would lead to a segfault.
This commit is contained in:
parent
5e220c1665
commit
ea55d0f5cb
3 changed files with 71 additions and 72 deletions
|
|
@ -38,4 +38,4 @@ typedef struct {
|
|||
|
||||
|
||||
int _get_ndevs();
|
||||
Stats _get_stats(int i);
|
||||
int _get_stats(Stats **stats);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue