From e2c2bc5a95889abea6a93507109ea1e20489b80d Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 5 Feb 2013 00:00:00 -0600 Subject: [PATCH] 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 1da293bf59187c734acfa89615265ecaf04b3a95 commit d747659ad80ac6e704ce0bc11150d13ab1622f6b Signed-off-by: Jim Warner --- top/top.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/top/top.c b/top/top.c index 1b06792d..6331dfe5 100644 --- a/top/top.c +++ b/top/top.c @@ -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];