posix: added check for port closing
This commit is contained in:
@@ -33,6 +33,7 @@ func (port *unixPort) Close() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if port.closeSignal != nil {
|
||||
// Send close signal to all pending reads (if any)
|
||||
port.closeSignal.Write([]byte{0})
|
||||
|
||||
@@ -44,6 +45,7 @@ func (port *unixPort) Close() error {
|
||||
if err := port.closeSignal.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user