fix: check CFE_SB_Subscribe return values in TO_LAB_init#233
Open
stark256-spec wants to merge 1 commit into
Open
fix: check CFE_SB_Subscribe return values in TO_LAB_init#233stark256-spec wants to merge 1 commit into
stark256-spec wants to merge 1 commit into
Conversation
Both CFE_SB_Subscribe calls for TO_LAB_CMD_MID and TO_LAB_SEND_HK_MID were silently ignoring the return status. A failure here means the application will not receive commands or housekeeping requests, but would continue initialising and report success to CFE_ES. Capture the return value for each call and emit a TO_LAB_SUBSCRIBE_ERR_EID event on failure, matching the error-handling style used throughout the rest of TO_LAB_init(). Each Subscribe is now guarded by a separate 'if (status == CFE_SUCCESS)' block so a failure in the first prevents the second from masking it. Fixes: nasa#229
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Both
CFE_SB_Subscribe()calls inTO_LAB_init()silently discard their return status. A failure means the application will not receive commands (TO_LAB_CMD_MID) or housekeeping requests (TO_LAB_SEND_HK_MID), yet it continues initialising and reports success toCFE_ES— making the fault invisible at startup.Fixes #229.
Changes
CFE_SB_Subscribe()call and assign it tostatusTO_LAB_SUBSCRIBE_ERR_EIDon failure, matching the error-handling style used throughout the rest ofTO_LAB_init()if (status == CFE_SUCCESS)blocks so a failure in the first prevents the second from masking itBefore / After