From bf4937bc910db2944dc50edd67bbd545e76821e2 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sun, 19 Jun 2016 23:36:39 -0700 Subject: Return exit code from run --- src/tty_interface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/tty_interface.c') diff --git a/src/tty_interface.c b/src/tty_interface.c index 03f71fb..e3329e3 100644 --- a/src/tty_interface.c +++ b/src/tty_interface.c @@ -113,7 +113,7 @@ void tty_interface_init(tty_interface_t *state, tty_t *tty, choices_t *choices, strncpy(state->search, options->init_search, SEARCH_SIZE_MAX); } -void tty_interface_run(tty_interface_t *state) { +int tty_interface_run(tty_interface_t *state) { tty_t *tty = state->tty; choices_t *choices = state->choices; char *search = state->search; @@ -164,7 +164,7 @@ void tty_interface_run(tty_interface_t *state) { emit(state); /* Return to eventually exit successfully */ - return; + return 0; } else if (ch == KEY_ESC) { /* ESC */ ch = tty_getchar(tty); if (ch == '[' || ch == 'O') { @@ -177,4 +177,6 @@ void tty_interface_run(tty_interface_t *state) { } } } while (1); + + return 0; } -- cgit v1.2.3