From 87bdcb2ae472711c3b0b3679fbdb393e39b4dbc3 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 25 Jan 2021 09:21:43 -0800 Subject: device: correct IPC error number for I/O errors Signed-off-by: Josh Bleecher Snyder --- device/uapi.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device/uapi.go b/device/uapi.go index 160806d..90a9952 100644 --- a/device/uapi.go +++ b/device/uapi.go @@ -168,7 +168,10 @@ func (device *Device) IpcSetOperation(r io.Reader) (err error) { } } - return scanner.Err() + if err := scanner.Err(); err != nil { + return ipcErrorf(ipc.IpcErrorIO, "failed to read input: %w", err) + } + return nil } func (device *Device) handleDeviceLine(key, value string) error { -- cgit v1.2.3