Diff between 9ab95ccb76012aac85f689570e092672973aea46 and 7bbf7c2b283a1e0c85fcb5fac2c7c1da0a474d4d

Changed Files

File Additions Deletions Status
monitor/control.c +3 -1 modified
monitor/control.h +1 -1 modified
monitor/main.c +4 -2 modified

Full Patch

diff --git a/monitor/control.c b/monitor/control.c
index 9e30d38..879e195 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -996,9 +996,11 @@ void control_server(const char *path)
 	server_fd = fd;
 }
 
-void control_writer(const char *path)
+bool control_writer(const char *path)
 {
 	btsnoop_file = btsnoop_create(path, BTSNOOP_TYPE_MONITOR);
+
+	return !!btsnoop_file;
 }
 
 void control_reader(const char *path)
diff --git a/monitor/control.h b/monitor/control.h
index 8de4c6c..28f16db 100644
--- a/monitor/control.h
+++ b/monitor/control.h
@@ -24,7 +24,7 @@
 
 #include <stdint.h>
 
-void control_writer(const char *path);
+bool control_writer(const char *path);
 void control_reader(const char *path);
 void control_server(const char *path);
 int control_tracing(void);
diff --git a/monitor/main.c b/monitor/main.c
index d4e8e6d..f0922eb 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -198,8 +198,10 @@ int main(int argc, char *argv[])
 		return EXIT_SUCCESS;
 	}
 
-	if (writer_path)
-		control_writer(writer_path);
+	if (writer_path && !control_writer(writer_path)) {
+		printf("Failed to open '%s'\n", writer_path);
+		return EXIT_FAILURE;
+	}
 
 	if (ellisys_server)
 		ellisys_enable(ellisys_server, ellisys_port);