]> granicus.if.org Git - procps-ng/commit
top: tweak that recent enhancement to startup defaults
authorJim Warner <james.warner@comcast.net>
Sun, 7 Jan 2018 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Mon, 12 Feb 2018 09:58:31 +0000 (20:58 +1100)
commit6f2e66969abb18a709b2a35ef447a91852df9610
treed40671959c71141bb93bf502eaad43699be25877
parent233b5228be49d7118642cef83e779769dda1c6d4
top: tweak that recent enhancement to startup defaults

When the new approach for startup defaults was adopted
in the reference below, a file might be left open that
technically should be closed. This situation arises in
the unlikely event the #define RCFILE_NOERR is active.

Without that #define, the program will exit early thus
rendering the open file issue moot. However, even with
that #define there was no real harm with an open file.
It simply meant a 2nd FILE struct would have been used
when, or if, the rcfile was written via a 'W' command.

Anyway, this patch ensures such a file will be closed.

Reference(s):
. Dec, 2017 - /etc/topdefaultrc introduced
commit 55a42ae040eaa19fd3089f56d98ccbde5a9abc3a

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c