src/fs.{cc,h}: Update fs_stats without error spam. #2033
Merged
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
◯ I have described the changes
◯ I have linked to any relevant GitHub issues, if applicable
Documentation in
doc/
has been updated (N/A)◯ All new code is licensed under GPLv3
Description
RE 788ac88, "conky: statfs64 '/media/usbstick': No such file or directory" spam in ~/.xsession-errors #208
update_fs_stats
was recently altered to clearset
for all file systems every thirteen seconds, and itsupdate_fs_stat
call was removed. This was done to mitigate a longstanding issue whereby repeated errors appeared when updates were attempted for a nonexistent mountpoint. However, before the change,update_fs_stat
was only called fromprepare_fs_stat
andupdate_fs_stats
. In consequence,update_fs_stat
is now called for each filesystem only at init time, and no changes are displayed.Updating capabilities can be restored by reverting the change to
update_fs_stats
. In addition, repeated error messages can be suppressed in the following manner:errored
and initialize to zero.errored
is zero; once this has been done, seterrored
.errored
so that a new message can appear.Filesystem information will be updated periodically as before. Nonexistent mountpoints now produce errors only once at init, and once more if an existing mountpoint is removed. That is, errors will no longer be produced at every update.
I ran patched
conky
from a terminal to monitor standard error using a config file that included a spurious mountpoint. I periodically made and deleted that directory, verifying that error messages appeared only once upon deletion. This worked both with and withoutif_mounted
. Live updates tofs_used
andfs_free
occurred as expected.