Closed skliper closed 2 years ago
I think you can flatten much of that logic since the break makes the additional nesting unnecessary... pseudocode pattern:
ret = function
if (ret != SUCCESS)
{
send event:
break;
}
ret = function
...
still wrap getting the sem id such that it's only performed if it's not empty.
Checklist (Please check before submitting)
Describe the bug Semaphore name being blank is not an error condition, it should simply skip the semaphore get by name call. The recent refactor changed this behavior which causes the engine to crash.
Error introduced here: https://github.com/nasa/CF/blob/eba87dfc5e9e1769df72815cdca52508c0afad39/fsw/src/cf_cfdp.c#L1046-L1084
Old code: https://github.com/nasa/CF/blob/bff67f871cc88fbd7f2399a029aacd088112978c/fsw/src/cf_cfdp.c#L1029-L1064
To Reproduce Initialize engine without a semaphore name defined
Expected behavior Still initialize the transactions if the semaphore name is blank
System observed on: Observed from CTF testing (on Linux I assume)
Additional context None
Reporter Info Jacob Hageman - NASA/GSFC