Fix build using Darwin and osxcross

This commit is contained in:
Martino Facchin
2017-02-13 16:02:49 +01:00
committed by Cristian Maglie
parent 0d8c7bfd78
commit 51237629e6

View File

@@ -22,14 +22,14 @@ func nativeGetDetailedPortsList() ([]*PortDetails, error) {
services, err := getAllServices("IOSerialBSDClient") services, err := getAllServices("IOSerialBSDClient")
if err != nil { if err != nil {
return nil, &PortError{code: ErrorEnumeratingPorts, causedBy: err} return nil, &PortEnumerationError{causedBy: err}
} }
for _, service := range services { for _, service := range services {
defer service.Release() defer service.Release()
port, err := extractPortInfo(C.io_registry_entry_t(service)) port, err := extractPortInfo(C.io_registry_entry_t(service))
if err != nil { if err != nil {
return nil, &PortError{code: ErrorEnumeratingPorts, causedBy: err} return nil, &PortEnumerationError{causedBy: err}
} }
ports = append(ports, port) ports = append(ports, port)
} }