From 1b3f5335d6236b925d5a11dba2c484cfa1c5ae7d Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Sun, 29 Sep 2024 15:08:11 +0100 Subject: [PATCH] [iwm] Return correct error code when there is a status call on non-opened protocol This was incorrectly returning 1, which is also the OK code and causing fujinet-lib to tightly loop as it did not think there was an error. --- lib/device/iwm/network.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/device/iwm/network.cpp b/lib/device/iwm/network.cpp index 1f3c0dc7f..6084358a3 100755 --- a/lib/device/iwm/network.cpp +++ b/lib/device/iwm/network.cpp @@ -500,14 +500,14 @@ void iwmNetwork::status() case NetworkData::PROTOCOL: if (!current_network_data.protocol) { Debug_printf("ERROR: Calling status on a null protocol.\r\n"); - err = true; - s.error = true; + err = NETWORK_ERROR_INVALID_COMMAND; + s.error = NETWORK_ERROR_INVALID_COMMAND; } else { err = current_network_data.protocol->status(&s); } break; case NetworkData::JSON: - err = current_network_data.json->status(&s); + err = (current_network_data.json->status(&s) == false) ? 0 : NETWORK_ERROR_GENERAL; break; }