Skip to content

Commit 655977e

Browse files
authored
Merge pull request #20 from emilio/interrupt
Handle EINTR.
2 parents b7d8bc9 + b6c1e95 commit 655977e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,11 @@ mod imp {
591591
loop {
592592
fd.revents = 0;
593593
if libc::poll(&mut fd, 1, -1) == -1 {
594-
return Err(io::Error::last_os_error());
594+
let e = io::Error::last_os_error();
595+
match e.kind() {
596+
io::ErrorKind::Interrupted => continue,
597+
_ => return Err(e),
598+
}
595599
}
596600
if fd.revents == 0 {
597601
continue;
@@ -605,8 +609,10 @@ mod imp {
605609
"early EOF on jobserver pipe",
606610
))
607611
}
608-
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {}
609-
Err(e) => return Err(e),
612+
Err(e) => match e.kind() {
613+
io::ErrorKind::WouldBlock | io::ErrorKind::Interrupted => continue,
614+
_ => return Err(e),
615+
},
610616
}
611617
}
612618
}

0 commit comments

Comments
 (0)