mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-11 03:51:41 +01:00
If gtk2 support is not enabled (or failed for some reason) try TUI again instead of falling directly back to the stdio interface. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Pekka Enberg <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
46 lines
629 B
C
46 lines
629 B
C
#include "../cache.h"
|
|
#include "../debug.h"
|
|
|
|
|
|
void setup_browser(bool fallback_to_pager)
|
|
{
|
|
if (!isatty(1) || dump_trace)
|
|
use_browser = 0;
|
|
|
|
/* default to TUI */
|
|
if (use_browser < 0)
|
|
use_browser = 1;
|
|
|
|
switch (use_browser) {
|
|
case 2:
|
|
if (perf_gtk__init() == 0)
|
|
break;
|
|
/* fall through */
|
|
case 1:
|
|
use_browser = 1;
|
|
if (ui__init() == 0)
|
|
break;
|
|
/* fall through */
|
|
default:
|
|
if (fallback_to_pager)
|
|
setup_pager();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void exit_browser(bool wait_for_ok)
|
|
{
|
|
switch (use_browser) {
|
|
case 2:
|
|
perf_gtk__exit(wait_for_ok);
|
|
break;
|
|
|
|
case 1:
|
|
ui__exit(wait_for_ok);
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|