From 42cc0c6d736f6d296ef2a6a636ddf8733cdcd7c6 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis <dirbaio@dirbaio.net> Date: Sun, 25 Dec 2022 22:02:50 +0100 Subject: [PATCH] print ioctl error as signed. --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 8e30522be..430821752 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -858,7 +858,10 @@ where if let IoctlState::Sent { buf } = self.state.ioctl_state.get() { if cdc_header.id == self.ioctl_id { - assert_eq!(cdc_header.status, 0); // todo propagate error instead + if cdc_header.status != 0 { + // TODO: propagate error instead + panic!("IOCTL error {=i32}", cdc_header.status as i32); + } let resp_len = cdc_header.len as usize; info!("IOCTL Response: {:02x}", &payload[CdcHeader::SIZE..][..resp_len]);