Since mainloop_run() overwrites the exit_status variable even if having called mainloop_{quit,exit_*}(), such as in case executing btmgmt with an invalid command, it is initialized in declaration. --- src/shared/mainloop.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/shared/mainloop.c b/src/shared/mainloop.c index 09c46a79a..e6ab9c43d 100644 --- a/src/shared/mainloop.c +++ b/src/shared/mainloop.c @@ -42,7 +42,7 @@ static int epoll_fd; static int epoll_terminate; -static int exit_status; +static int exit_status = EXIT_SUCCESS; struct mainloop_data { int fd; @@ -141,8 +141,6 @@ int mainloop_run(void) } } - exit_status = EXIT_SUCCESS; - while (!epoll_terminate) { struct epoll_event events[MAX_EPOLL_EVENTS]; int n, nfds; -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html