]> granicus.if.org Git - procps-ng/commit
top: tweak that recent enhancement to startup defaults
authorJim Warner <james.warner@comcast.net>
Fri, 5 Jan 2018 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Mon, 12 Feb 2018 09:53:56 +0000 (20:53 +1100)
commitdfa118b4d5757013d08d52dcd796fdde7dba3034
tree9d0d2a6309e292e265556c41262d0839f90f7cf5
parente82dd07b3b4b4f7df7a7ffb291f19351623d3e71
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 3e6a208ae501194fdb39d5f259e327c087dc8c84

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