Skip to content

Commit

Permalink
change return value for non-existent state
Browse files Browse the repository at this point in the history
  • Loading branch information
poetinger committed Nov 20, 2023
1 parent 9800bdc commit 0a4488c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/ddsc/src/dds_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,15 @@ dds_return_t dds_set_domain_lifecycle(const dds_entity_t domain, const enum dds_
if (result == DDS_RETCODE_OK) {
LIFECYCLE_STATE = state;
} // else result is the error from ddsrt_lock()
} else {
} else { // only allow init->operational
result = DDS_RETCODE_PRECONDITION_NOT_MET;
}
break;
case DDS_DOMAIN_LIFECYCLE_INITIALISATION:
result = DDS_RETCODE_PRECONDITION_NOT_MET;
break;
default:
result = DDS_RETCODE_ERROR;
default: // for MISRA compliance, no fall through :(
result = DDS_RETCODE_PRECONDITION_NOT_MET;
break;
}
} else {
Expand Down

0 comments on commit 0a4488c

Please sign in to comment.