Diff between 9dc47e653d5e46cd0e1f0b75f001dde22e2a446c and 180da70291508c099a7f60f9a994488fc3137909

Changed Files

File Additions Deletions Status
monitor/main.c +6 -3 modified

Full Patch

diff --git a/monitor/main.c b/monitor/main.c
index 38e4fc9..be3d55e 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -224,10 +224,13 @@ int main(int argc, char *argv[])
 	if (ellisys_server)
 		ellisys_enable(ellisys_server, ellisys_port);
 
-	if (tty)
-		control_tty(tty, tty_speed);
+	if (tty && control_tty(tty, tty_speed) < 0)
+		return EXIT_FAILURE;
 
-	if (control_tracing() < 0)
+	/* Accept error here if we have a successfully opened TTY
+	 * (could happen if btmon is run as a normal user).
+	 */
+	if (control_tracing() < 0 && !tty)
 		return EXIT_FAILURE;
 
 	exit_status = mainloop_run();