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

Fix #1362, Simplify CFE_ES_QueryAllCmd file open logic #1582

Merged
merged 1 commit into from
May 27, 2021

Conversation

skliper
Copy link
Contributor

@skliper skliper commented May 26, 2021

Describe the contribution
Fix #1362 - removes the first OS_OpenCreate (and file remove on success) since the following OS_OpenCreate with truncate makes it obsolete

Testing performed
Build/run unit tests, passed (once updated)

Expected behavior changes
None

System(s) tested on

  • Hardware: Intel I5/Docker
  • OS: Ubuntu 18.04
  • Versions: Bundle main + this commit

Additional context
None

Third party code
None

Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC

@skliper skliper added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label May 26, 2021
@skliper skliper added this to the 7.0.0 milestone May 26, 2021
Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is OK the similar logic appears elsewhere in cFE core too, even again in the same file.

/*
** Check to see if the file already exists
*/
Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY);
if (Result >= 0)
{
OS_close(FileDescriptor);
OS_remove(QueryAllFilename);
}

@jphickey
Copy link
Contributor

Note, I double checked the other cFE core modules again, I don't see any other occurrences of this anymore. So the only other issue is the one in CFE_ES_QueryAllTasksCmd above.

@skliper skliper removed the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label May 26, 2021
- Updated CFE_ES_QueryAllCmd handler
- Updated CFE_ES_QueryAllTasksCmd handler
@skliper skliper force-pushed the fix1362-open_truncate branch from 491930b to 560111c Compare May 26, 2021 14:36
@skliper
Copy link
Contributor Author

skliper commented May 26, 2021

560111c removes the other case (and updates commit to reflect additional change)

@skliper skliper added CCB:Ready Ready for discussion at the Configuration Control Board (CCB) CCB:Approved Indicates code review and approval by community CCB labels May 26, 2021
@astrogeco astrogeco removed the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label May 27, 2021
@astrogeco astrogeco changed the base branch from main to integration-candidate May 27, 2021 16:17
@astrogeco astrogeco merged commit 2a93eaf into nasa:integration-candidate May 27, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request May 27, 2021
nasa/cFE#1584

Includes:

nasa/cFE#1580, Update ES verify errors to match test
nasa/cFE#1578, Resolve mismatched endforeach of CMakeList.txt
nasa/cFE#1579, Improve event filter documentation
nasa/cFE#1576, EVS/FS documentation cleanup
nasa/cFE#1575, Remove shell file subtype and clarify scope
nasa/cFE#1582, Simplify file open/truncate logic
nasa/cFE#1567, Remove deprecated elements
nasa/cFE#1556, Replace Header Content Type magic number
nasa/cFE#1553, Remove unused EVS LogMode defines
nasa/cFE#1570, Document cleanup from SB/MSG/SBR review, Remove unused CFE_SB_NO_SUBSCRIBERS
nasa/cFE#1565, Add CFE_SB_DestinationD tag and use for pointers
nasa/cFE#1564, Use CFE_MSG_SequenceCount_t for seqcnt type
nasa/cFE#1562, Document CFE_ES_PoolCreateEx NumBlockSizes error handling
nasa/cFE#1560, Documentation cleanup in TBL/TIME
nasa/cFE#1558, Document TblName as app specific
astrogeco added a commit to nasa/cFS that referenced this pull request Jun 1, 2021
nasa/cFE#1584

Includes:

nasa/cFE#1580, Update ES verify errors to match test
nasa/cFE#1578, Resolve mismatched endforeach of CMakeList.txt
nasa/cFE#1579, Improve event filter documentation
nasa/cFE#1576, EVS/FS documentation cleanup
nasa/cFE#1575, Remove shell file subtype and clarify scope
nasa/cFE#1582, Simplify file open/truncate logic
nasa/cFE#1567, Remove deprecated elements
nasa/cFE#1556, Replace Header Content Type magic number
nasa/cFE#1553, Remove unused EVS LogMode defines
nasa/cFE#1570, Document cleanup from SB/MSG/SBR review, Remove unused CFE_SB_NO_SUBSCRIBERS
nasa/cFE#1565, Add CFE_SB_DestinationD tag and use for pointers
nasa/cFE#1564, Use CFE_MSG_SequenceCount_t for seqcnt type
nasa/cFE#1562, Document CFE_ES_PoolCreateEx NumBlockSizes error handling
nasa/cFE#1560, Documentation cleanup in TBL/TIME
nasa/cFE#1558, Document TblName as app specific
astrogeco added a commit to nasa/cFS that referenced this pull request Jun 8, 2021
- #263, bundle

Combines:

- nasa/cFE#1584, v6.8.0-rc1+dev642
- nasa/osal#1058, v5.1.0-rc1+dev500
- nasa/sch_lab#82, v2.4.0-rc1+dev36

Includes:

- nasa/cFE#1580, Update ES verify errors to match test
- nasa/cFE#1578, Resolve mismatched endforeach of CMakeList.txt
- nasa/cFE#1579, Improve event filter documentation
- nasa/cFE#1576, EVS/FS documentation cleanup
- nasa/cFE#1575, Remove shell file subtype and clarify scope
- nasa/cFE#1582, Simplify file open/truncate logic
- nasa/cFE#1567, Remove deprecated elements
- nasa/cFE#1556, Replace Header Content Type magic number
- nasa/cFE#1553, Remove unused EVS LogMode defines
- nasa/cFE#1570, Document cleanup from SB/MSG/SBR review, Remove unused CFE_SB_NO_SUBSCRIBERS
- nasa/cFE#1565, Add CFE_SB_DestinationD tag and use for pointers
- nasa/cFE#1564, Use CFE_MSG_SequenceCount_t for seqcnt type
- nasa/cFE#1562, Document CFE_ES_PoolCreateEx NumBlockSizes error handling
- nasa/cFE#1560, Documentation cleanup in TBL/TIME
- nasa/cFE#1558, Document TblName as app specific
- nasa/cFE#1563, use OSAL script to generate API guide
- nasa/cFE#1557, Include verify headers to validate config
- nasa/cFE#1555, add doxygen aliases for OSAL parameter/retvals

- nasa/osal#1033, include doxygen targets locally
- nasa/osal#1031, Document OS_ObjectIdToArrayIndex as public
- nasa/osal#1040, resolve discrepancies between binsem API and unit tests
- nasa/osal#1029, add missing clock retcode tests
- nasa/osal#1046, resolve discrepancies between common API and unit tests
- nasa/osal#1041, resolve discrepancies between countsem API and unit tests
- nasa/osal#1045, resolve discrepancies between dir API and unit tests
- nasa/osal#1043, resolve discrepancies between module API and unit tests
- nasa/osal#1044, resolve discrepancies between mutex API and unit tests
- nasa/osal#1038, resolve discrepancies between queue API and unit tests
- nasa/osal#1037, resolve discrepancies between task API and unit tests
- nasa/osal#1051, resolve discrepancies between timebase API and unit tests
- nasa/osal#1030, check misc API return codes
- nasa/osal#1039, Rename CodeQL cFE Build and add Duplicate Job
- nasa/osal#1049, filter only whole words for keyword match
- nasa/osal#962, update OSAL Config Guide link

- nasa/sch_lab#81, exit the main loop if init fails

- HOTFIX cFS-bundle, Use new osalguide logfile to fix documentation build
workflow errors,
astrogeco added a commit to nasa/cFS that referenced this pull request Jun 8, 2021
- #263, bundle

Combines:

- nasa/cFE#1584, v6.8.0-rc1+dev642
- nasa/osal#1058, v5.1.0-rc1+dev500
- nasa/sch_lab#82, v2.4.0-rc1+dev36

Includes:

- nasa/cFE#1580, Update ES verify errors to match test
- nasa/cFE#1578, Resolve mismatched endforeach of CMakeList.txt
- nasa/cFE#1579, Improve event filter documentation
- nasa/cFE#1576, EVS/FS documentation cleanup
- nasa/cFE#1575, Remove shell file subtype and clarify scope
- nasa/cFE#1582, Simplify file open/truncate logic
- nasa/cFE#1567, Remove deprecated elements
- nasa/cFE#1556, Replace Header Content Type magic number
- nasa/cFE#1553, Remove unused EVS LogMode defines
- nasa/cFE#1570, Document cleanup from SB/MSG/SBR review, Remove unused CFE_SB_NO_SUBSCRIBERS
- nasa/cFE#1565, Add CFE_SB_DestinationD tag and use for pointers
- nasa/cFE#1564, Use CFE_MSG_SequenceCount_t for seqcnt type
- nasa/cFE#1562, Document CFE_ES_PoolCreateEx NumBlockSizes error handling
- nasa/cFE#1560, Documentation cleanup in TBL/TIME
- nasa/cFE#1558, Document TblName as app specific
- nasa/cFE#1563, use OSAL script to generate API guide
- nasa/cFE#1557, Include verify headers to validate config
- nasa/cFE#1555, add doxygen aliases for OSAL parameter/retvals

- nasa/osal#1033, include doxygen targets locally
- nasa/osal#1031, Document OS_ObjectIdToArrayIndex as public
- nasa/osal#1040, resolve discrepancies between binsem API and unit tests
- nasa/osal#1029, add missing clock retcode tests
- nasa/osal#1046, resolve discrepancies between common API and unit tests
- nasa/osal#1041, resolve discrepancies between countsem API and unit tests
- nasa/osal#1045, resolve discrepancies between dir API and unit tests
- nasa/osal#1043, resolve discrepancies between module API and unit tests
- nasa/osal#1044, resolve discrepancies between mutex API and unit tests
- nasa/osal#1038, resolve discrepancies between queue API and unit tests
- nasa/osal#1037, resolve discrepancies between task API and unit tests
- nasa/osal#1051, resolve discrepancies between timebase API and unit tests
- nasa/osal#1030, check misc API return codes
- nasa/osal#1039, Rename CodeQL cFE Build and add Duplicate Job
- nasa/osal#1049, filter only whole words for keyword match
- nasa/osal#962, update OSAL Config Guide link

- nasa/sch_lab#81, exit the main loop if init fails

- HOTFIX cFS-bundle, Use new osalguide logfile to fix documentation build
workflow errors,

Co-authored-by: Joseph Hickey <[email protected]>
Co-authored-by: Jake Hageman skliper <[email protected]>
Co-authored-by: Alex Campbell <[email protected]>
Co-authored-by: Ariel Adams <[email protected]>
Co-authored-by: Ross Peters <[email protected]>
@skliper skliper deleted the fix1362-open_truncate branch October 22, 2021 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obsolete logic in CFE_ES_QueryAllCmd file handling (related to OpenCreate)
3 participants