From 0afa60bd977ecfe78ad156407e7828e86a34f8dd Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 7 Jan 2016 22:02:12 +0100 Subject: [PATCH] Return a more appropriate error code. The DC_STATUS_IO code is intended for reporting low-level I/O errors. That's not the case here, and there are more appropriate error codes available. --- src/hw_ostc3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hw_ostc3.c b/src/hw_ostc3.c index 9b81055..6f19bc4 100644 --- a/src/hw_ostc3.c +++ b/src/hw_ostc3.c @@ -385,7 +385,7 @@ hw_ostc3_device_init_service (hw_ostc3_device_t *device) output[2] != 0xCD || output[3] != 0xEF || output[4] != S_READY) { ERROR (context, "Failed to verify echo."); - return DC_STATUS_IO; + return DC_STATUS_PROTOCOL; } device->state = SERVICE; @@ -1011,7 +1011,7 @@ hw_ostc3_firmware_readfile (hw_ostc3_firmware_t *firmware, dc_context_t *context if (firmware->checksum != hw_ostc3_firmware_checksum (firmware)) { ERROR (context, "Failed to verify file checksum."); - return DC_STATUS_IO; + return DC_STATUS_DATAFORMAT; } return DC_STATUS_SUCCESS;