[PATCH BlueZ 6/6] shared/mainloop: Fix overwriting exit status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux