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

process_stats.c:480:4: warning: ignoring return value of ‘fgets’ #91

Closed
tdb opened this issue Sep 23, 2018 · 0 comments
Closed

process_stats.c:480:4: warning: ignoring return value of ‘fgets’ #91

tdb opened this issue Sep 23, 2018 · 0 comments

Comments

@tdb
Copy link
Member

tdb commented Sep 23, 2018

https://github.com/i-scream/libstatgrab/blob/master/src/libstatgrab/process_stats.c#L480

process_stats.c: In function ‘sg_get_process_stats_int’:
process_stats.c:480:4: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
    fgets(read_buf, READBUF_LENGTH, f);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Added in ca9fa77 (unreleased).

@rehsack rehsack mentioned this issue Nov 11, 2018
rehsack added a commit to rehsack/libstatgrab that referenced this issue Nov 14, 2018
While scanning /proc, when a process disappears, continue scanning
instead of working on possible unintialized memory due race condition.

Thanks @tdb for reporting (libstatgrab#91)

On possible retry failure during fetch all process info via MIB
on *BSD, free previously allocated memory on bail out on error.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
tdb pushed a commit to tdb/libstatgrab that referenced this issue Nov 14, 2018
While scanning /proc, when a process disappears, continue scanning
instead of working on possible unintialized memory due race condition.

Thanks @tdb for reporting (libstatgrab#91)

On possible retry failure during fetch all process info via MIB
on *BSD, free previously allocated memory on bail out on error.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
tdb pushed a commit to tdb/libstatgrab that referenced this issue Nov 14, 2018
While scanning /proc, when a process disappears, continue scanning
instead of working on possible unintialized memory due race condition.

Thanks @tdb for reporting (libstatgrab#91)

On possible retry failure during fetch all process info via MIB
on *BSD, free previously allocated memory on bail out on error.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
@tdb tdb closed this as completed Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant