mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
229ade9ba3
Because in tools like 'top' we don't want the pager. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
44 lines
755 B
C
44 lines
755 B
C
#include <newt.h>
|
|
#include <signal.h>
|
|
#include <stdbool.h>
|
|
|
|
#include "../cache.h"
|
|
#include "../debug.h"
|
|
#include "browser.h"
|
|
#include "helpline.h"
|
|
|
|
static void newt_suspend(void *d __used)
|
|
{
|
|
newtSuspend();
|
|
raise(SIGTSTP);
|
|
newtResume();
|
|
}
|
|
|
|
void setup_browser(bool fallback_to_pager)
|
|
{
|
|
if (!isatty(1) || !use_browser || dump_trace) {
|
|
use_browser = 0;
|
|
if (fallback_to_pager)
|
|
setup_pager();
|
|
return;
|
|
}
|
|
|
|
use_browser = 1;
|
|
newtInit();
|
|
newtCls();
|
|
newtSetSuspendCallback(newt_suspend, NULL);
|
|
ui_helpline__init();
|
|
ui_browser__init();
|
|
}
|
|
|
|
void exit_browser(bool wait_for_ok)
|
|
{
|
|
if (use_browser > 0) {
|
|
if (wait_for_ok) {
|
|
char title[] = "Fatal Error", ok[] = "Ok";
|
|
newtWinMessage(title, ok, ui_helpline__last_msg);
|
|
}
|
|
newtFinished();
|
|
}
|
|
}
|