top: the third time was charmed for end-of-job reports

When top was changed to allow some core dumps, the two
potential end-of-job reports were disabled by mistake.
Later, that was corrected so that those reports always
were allowed, if the respective #defines were enabled.

However, if there was an early exit via a command line
option or an error, those reports should not be shown.

This commit may have gotten it right on our third try!

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Reference(s):
commit 1da293bf59
commit d747659ad8

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2013-02-05 00:00:00 -06:00 committed by Craig Small
parent cff3960c4a
commit e2c2bc5a95

View File

@ -343,7 +343,6 @@ static void at_eoj (void) {
#ifndef RMAN_IGNORED
putp(Cap_smam);
#endif
Ttychanged = 0;
}
fflush(stdout);
} // end: at_eoj
@ -356,7 +355,7 @@ static void bye_bye (const char *str) {
at_eoj(); // restore tty in preparation for exit
#ifdef ATEOJ_RPTSTD
{ proc_t *p;
if (!str) { fprintf(stderr,
if (!str && Ttychanged) { fprintf(stderr,
"\n%s's Summary report:"
"\n\tProgram"
"\n\t Linux version = %u.%u.%u, %s"
@ -426,7 +425,7 @@ static void bye_bye (const char *str) {
#ifndef OFF_HST_HASH
#ifdef ATEOJ_RPTHSH
if (!str) {
if (!str && Ttychanged) {
int i, j, pop, total_occupied, maxdepth, maxdepth_sav, numdepth
, cross_foot, sz = HHASH_SIZ * (unsigned)sizeof(int);
int depths[HHASH_SIZ];