diff --git a/src/shared/shell.c b/src/shared/shell.c
index 33bc0d9..b503c66 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
free(env);
}
-void bt_shell_run(void)
+int bt_shell_run(void)
{
struct io *signal;
+ int status;
signal = setup_signalfd();
- mainloop_run();
+ status = mainloop_run();
io_destroy(signal);
bt_shell_cleanup();
+
+ return status;
}
void bt_shell_cleanup(void)
diff --git a/src/shared/shell.h b/src/shared/shell.h
index 33c31f3..8b7cb7f 100644
--- a/src/shared/shell.h
+++ b/src/shared/shell.h
void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt);
-void bt_shell_run(void);
+int bt_shell_run(void);
void bt_shell_quit(int status);
void bt_shell_noninteractive_quit(int status);