Fix nasa#484, will check the lseek() return value in linux_sysmon_upd…#485
Open
myc-yang wants to merge 1 commit into
Open
Fix nasa#484, will check the lseek() return value in linux_sysmon_upd…#485myc-yang wants to merge 1 commit into
myc-yang wants to merge 1 commit into
Conversation
…ate_schedstat() in fsw/modules/linux_sysmon/linux_sysmon.c
jphickey
requested changes
May 22, 2026
Contributor
jphickey
left a comment
There was a problem hiding this comment.
This doesn't seem to add value. If the lseek failed for whatever reason, the later read will fail, and this will end up following the error paths from there.
While I agree that the error checking here could be better, I'm not sure this improves it. As this is linux-specific code, we should at least capture errno and print the message.
Also - as a side note - 0 is the only valid output from this call because it is SEEK_SET. Any nonzero value means it did not seek correctly.
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.
Checklist (Please check before submitting)
Describe the contribution
Fixes #484, will check the lseek() return value in linux_sysmon_update_schedstat() in fsw/modules/linux_sysmon/linux_sysmon.c
Testing performed
Expected behavior changes
When running the linux system monitor, if there is an issue going to the beginning of the /proc/schedstat file, a message will be printed out
System(s) tested on
Additional context
Add any other context about the contribution here.
Third party code
If included, identify any third party code and provide text file of license
Contributor Info - All information REQUIRED for consideration of pull request
Michael Yang NASA/GSFC