|
@@ -98,11 +98,16 @@ func WaitForRead(dev Device) <-chan struct{} {
|
|
|
fdsRead.Zero()
|
|
|
fdsRead.Set(int(fd))
|
|
|
tv := sys.Timeval{Sec: 2, Usec: 0}
|
|
|
- _, errno := sys.Select(int(fd+1), &fdsRead, nil, nil, &tv)
|
|
|
+ n, errno := sys.Select(int(fd+1), &fdsRead, nil, nil, &tv)
|
|
|
if errno == sys.EINTR {
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
+ if n == 0 {
|
|
|
+ // timeout, no data available
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
sigChan <- struct{}{}
|
|
|
}
|
|
|
}(dev.Fd())
|