Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return success on multiple OS_API_Init calls #871

Closed
skliper opened this issue Mar 10, 2021 · 0 comments · Fixed by #941 or #956
Closed

Return success on multiple OS_API_Init calls #871

skliper opened this issue Mar 10, 2021 · 0 comments · Fixed by #941 or #956

Comments

@skliper
Copy link
Contributor

skliper commented Mar 10, 2021

Is your feature request related to a problem? Please describe.
OS_API_Init writes error to the syslog and returns error if called multiple times. Doesn't really cause any issues, could just write to the syslog and return success.

if (OS_SharedGlobalVars.Initialized != false)
{
OS_DEBUG("WARNING: BUG - initialization function called multiple times\n");
return OS_ERROR;
}

Describe the solution you'd like
Consider returning success

Describe alternatives you've considered
Leave as-is (future work)

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC, OSAL code review

jphickey added a commit to jphickey/osal that referenced this issue Apr 2, 2021
Replaces the separate "Initialized" and "Shutdown" flags with a single
state flag.  This simplifies things and makes for a single source
of truth for the state of OSAL globally.

In particular this allows for:
- Multiple invocations of OS_API_Init() - subsequent calls can be ignored
- Deleting of any internal objects that did get created if OS_API_Init() fails
  (leaves system in same state as when it started)
- Allows Re-initialization of OSAL after OS_ApplicationShutdown() - may be
  relevant when running unit tests several times without rebooting.
jphickey added a commit to jphickey/osal that referenced this issue Apr 2, 2021
Replaces the separate "Initialized" and "Shutdown" flags with a single
state flag.  This simplifies things and makes for a single source
of truth for the state of OSAL globally.

In particular this allows for:
- Multiple invocations of OS_API_Init() - subsequent calls can be ignored
- Deleting of any internal objects that did get created if OS_API_Init() fails
  (leaves system in same state as when it started)
- Allows Re-initialization of OSAL after OS_ApplicationShutdown() - may be
  relevant when running unit tests several times without rebooting.
jphickey added a commit to jphickey/osal that referenced this issue Apr 6, 2021
Replaces the separate "Initialized" and "Shutdown" flags with a single
state flag.  This simplifies things and makes for a single source
of truth for the state of OSAL globally.

In particular this allows for:
- Multiple invocations of OS_API_Init() - subsequent calls can be ignored
- Deleting of any internal objects that did get created if OS_API_Init() fails
  (leaves system in same state as when it started)
- Allows Re-initialization of OSAL after OS_ApplicationShutdown() - may be
  relevant when running unit tests several times without rebooting.
astrogeco added a commit that referenced this issue Apr 11, 2021
@skliper skliper added this to the 6.0.0 milestone Sep 24, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant