Skip to content

Commit 1b3f533

Browse files
committed
[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.
1 parent 78e4c01 commit 1b3f533

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/device/iwm/network.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,14 +500,14 @@ void iwmNetwork::status()
500500
case NetworkData::PROTOCOL:
501501
if (!current_network_data.protocol) {
502502
Debug_printf("ERROR: Calling status on a null protocol.\r\n");
503-
err = true;
504-
s.error = true;
503+
err = NETWORK_ERROR_INVALID_COMMAND;
504+
s.error = NETWORK_ERROR_INVALID_COMMAND;
505505
} else {
506506
err = current_network_data.protocol->status(&s);
507507
}
508508
break;
509509
case NetworkData::JSON:
510-
err = current_network_data.json->status(&s);
510+
err = (current_network_data.json->status(&s) == false) ? 0 : NETWORK_ERROR_GENERAL;
511511
break;
512512
}
513513

0 commit comments

Comments
 (0)