1
Fork 0

Redefine ErrorKind::Other and stop using it in std.

This commit is contained in:
Mara Bos 2021-05-27 14:03:35 +02:00
parent cdbe288897
commit 0b37bb2bc2
24 changed files with 89 additions and 75 deletions

View file

@ -38,7 +38,7 @@ pub fn cvt_gai(err: c_int) -> io::Result<()> {
str::from_utf8(CStr::from_ptr(libc::gai_strerror(err)).to_bytes()).unwrap().to_owned()
};
Err(io::Error::new(
io::ErrorKind::Other,
io::ErrorKind::Unknown,
&format!("failed to lookup address information: {}", detail)[..],
))
}
@ -178,7 +178,7 @@ impl Socket {
if pollfd.revents & libc::POLLHUP != 0 {
let e = self.take_error()?.unwrap_or_else(|| {
io::Error::new_const(
io::ErrorKind::Other,
io::ErrorKind::Unknown,
&"no error set after POLLHUP",
)
});