Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/4] android: Add simple rotation of snoop file
@ 2014-01-15 21:01 Andrzej Kaczmarek
  2014-01-15 21:01 ` [PATCH 2/4] android: Fix typo Andrzej Kaczmarek
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Andrzej Kaczmarek @ 2014-01-15 21:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek

Already existing snoop file is renamed by adding ".old" suffix before
new one is created. This is useful in case phone is restarted so logs
are not overwritten and for this reason it's only applied in case
default snoop file name is used.
---
 android/bluetoothd-snoop.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/android/bluetoothd-snoop.c b/android/bluetoothd-snoop.c
index 02f44e9..23e0bfd 100644
--- a/android/bluetoothd-snoop.c
+++ b/android/bluetoothd-snoop.c
@@ -206,6 +206,9 @@ int main(int argc, char *argv[])
 
 	mainloop_set_signal(&mask, signal_callback, NULL, NULL);
 
+	if (!strcmp(DEFAULT_SNOOP_FILE, path))
+		rename(DEFAULT_SNOOP_FILE, DEFAULT_SNOOP_FILE ".old");
+
 	if (open_monitor(path) < 0) {
 		printf("Failed to start bluetoothd_snoop\n");
 		return EXIT_FAILURE;
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-16  8:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 21:01 [PATCH 1/4] android: Add simple rotation of snoop file Andrzej Kaczmarek
2014-01-15 21:01 ` [PATCH 2/4] android: Fix typo Andrzej Kaczmarek
2014-01-15 21:01 ` [PATCH 3/4] android/a2dp: Fix memory leak Andrzej Kaczmarek
2014-01-15 21:01 ` [PATCH 4/4] " Andrzej Kaczmarek
2014-01-16  8:02 ` [PATCH 1/4] android: Add simple rotation of snoop file Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox