device: correct IPC error number for I/O errors

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder 2021-01-25 09:21:43 -08:00
parent 37a239e736
commit 87bdcb2ae4

View file

@ -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 {