Skip to content

Commit

Permalink
Merge pull request #165 from cmaglie/fix_darwin_enumerator
Browse files Browse the repository at this point in the history
Fix some rare MacOSX USB port enumerator failures
  • Loading branch information
cmaglie authored Sep 14, 2023
2 parents 2e90307 + f3f0122 commit 8a31fcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enumerator/usb_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func getAllServices(serviceType string) ([]io_object_t, error) {
services = append(services, service)
continue
}
// If iterator is still valid return the result
if i.IsValid() {
// If the list of services is empty or the iterator is still valid return the result
if len(services) == 0 || i.IsValid() {
return services, nil
}
// Otherwise empty the result and retry
Expand Down

0 comments on commit 8a31fcb

Please sign in to comment.