Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/usr.bin/systat
Module Name: src
Committed By: kre
Date: Mon Mar 27 23:20:13 UTC 2023
Modified Files:
src/usr.bin/systat: disks.c
Log Message:
Undo previous "restore lost break" and fix the issue that seems to
have been intending to correct properly (or at least, more rationally).
This makes adding/deleting drives for "vmstat" (and "iostat", though
the man page doesn't say that it also works there) using the :display
:ignore and :drive sub-commands work sensibly using fnmatch()
rather than what was there most of the time since it was added.
Previously ":ignore dk*" would ignore the first dk (wedge) found in
the system (whether or not it was ignored already) and that was it.
[":ignore dk* dk*" would just do that twice.]
Now the same command will ignore all dk* drives (all wedges), which
is what I would anticipate almost anyone would expect it to do.
Similarly for ":display" (to add drives) and ":drives" to explictly
list particular ones.
When the fnmatch() code was added, almost 9 and a half years ago now,
it was almost correct - except always resulted in an error occurring
(though that was little more than a minor inconvenience).
That was "fixed" 5 months later (9 years and almost a month ago now)
with the cvs log message "restore lost break" - which was absolutely
the wrong thing to do (the break was fine when no patterns were used,
and so a name could only ever match one drive - but wrong when the
whole point is to match many).
Somehow in the past 9+ years, no-one noticed that this functionality
had been rendered almost useless.
While here, fix a related problem ... just above I referred to the
error that occurred as a "minor inconvenience" - that's because while
an error would be shown on the screen, it would then immediately be
removed again, an observant user might notice the quick flash, but
that would be it.
Handle that by detecting whether any changes are actually made, and
don't go completely redrawing the screen (removing the error message
that was just placed there) if there is no point. This doesn't
entirely fix this problem, as if we do
:drives foo wd*
and there is no "foo" drive in the system, we'd get an error message
from that, but adding the wd* drives (assuming there are some, of course)
counts as a change, so that error message will still not last very long.
The order of that command line makes no difference, it isn't that wd drives
were found after foo wasn't, but that the whole line matched (at least one)
drive (and changed its state - for the "drives" command, that is equivalent
to matched) - but also contained an entry which did not match at all.
That's a harder problem to fix.
No pullups planned, as no-one seems to mind how it has been all this time.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/systat/disks.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index