From 140ca729aa3bf4b24e40c46534dbc9bf907e0a21 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 15 May 2018 08:27:45 +0000 Subject: [PATCH] =?UTF-8?q?firmware:=20rename=20io::Error::{UnexpectedEof?= =?UTF-8?q?=E2=86=92UnexpectedEnd}.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't even have files. --- artiq/firmware/ksupport/lib.rs | 2 +- artiq/firmware/libio/lib.rs | 6 +++--- artiq/firmware/runtime/mgmt.rs | 2 +- artiq/firmware/runtime/session.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/artiq/firmware/ksupport/lib.rs b/artiq/firmware/ksupport/lib.rs index 229e616c2..e2f7696a2 100644 --- a/artiq/firmware/ksupport/lib.rs +++ b/artiq/firmware/ksupport/lib.rs @@ -129,7 +129,7 @@ extern fn rpc_send_async(service: u32, tag: CSlice, data: *const *const ()) }; io::ProtoWrite::write_u32(&mut slice, length as u32) }).unwrap_or_else(|err| { - assert!(err == io::Error::UnexpectedEof); + assert!(err == io::Error::UnexpectedEnd); while !rpc_queue::empty() {} send(&RpcSend { diff --git a/artiq/firmware/libio/lib.rs b/artiq/firmware/libio/lib.rs index 486e4ae7b..654f68c36 100644 --- a/artiq/firmware/libio/lib.rs +++ b/artiq/firmware/libio/lib.rs @@ -26,7 +26,7 @@ pub type Result = result::Result>; #[derive(Fail, Debug, Clone, PartialEq)] pub enum Error { #[fail(display = "unexpected end of stream")] - UnexpectedEof, + UnexpectedEnd, #[fail(display = "unrecognized input")] Unrecognized, #[fail(display = "{}", _0)] @@ -51,7 +51,7 @@ pub trait Read { while !buf.is_empty() { let read_bytes = self.read(buf)?; if read_bytes == 0 { - return Err(Error::UnexpectedEof) + return Err(Error::UnexpectedEnd) } buf = &mut { buf }[read_bytes..]; @@ -85,7 +85,7 @@ pub trait Write { while buf.len() > 0 { let written_bytes = self.write(buf)?; if written_bytes == 0 { - return Err(Error::UnexpectedEof) + return Err(Error::UnexpectedEnd) } buf = &buf[written_bytes..]; diff --git a/artiq/firmware/runtime/mgmt.rs b/artiq/firmware/runtime/mgmt.rs index 574f55df8..b23b6bbcc 100644 --- a/artiq/firmware/runtime/mgmt.rs +++ b/artiq/firmware/runtime/mgmt.rs @@ -165,7 +165,7 @@ pub fn thread(io: Io) { let mut stream = TcpStream::from_handle(&io, stream); match worker(&io, &mut stream) { Ok(()) => (), - Err(io::Error::UnexpectedEof) => (), + Err(io::Error::UnexpectedEnd) => (), Err(err) => error!("aborted: {}", err) } }); diff --git a/artiq/firmware/runtime/session.rs b/artiq/firmware/runtime/session.rs index 63e397776..dced8025c 100644 --- a/artiq/firmware/runtime/session.rs +++ b/artiq/firmware/runtime/session.rs @@ -674,7 +674,7 @@ pub fn thread(io: Io) { let mut stream = TcpStream::from_handle(&io, stream); match host_kernel_worker(&io, &mut stream, &mut *congress) { Ok(()) => (), - Err(io::Error::UnexpectedEof) => { + Err(io::Error::UnexpectedEnd) => { info!("connection closed"); } Err(io::Error::Other(ref err))