linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] device: Remove storage path #defines
@ 2012-11-15 17:31 Frédéric Danis
  2012-11-15 17:31 ` [PATCH 2/8] device: Device_remove_stored removes device directory Frédéric Danis
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Frédéric Danis @ 2012-11-15 17:31 UTC (permalink / raw)
  To: linux-bluetooth

INFO_PATH and CACHE_PATH will be static for the
entire 5.x series
---
 src/device.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/device.c b/src/device.c
index 4ca375b..e3570cb 100644
--- a/src/device.c
+++ b/src/device.c
@@ -76,9 +76,6 @@
 #define DISCONNECT_TIMER	2
 #define DISCOVERY_TIMER		2
 
-#define INFO_PATH STORAGEDIR "/%s/%s/info"
-#define CACHE_PATH STORAGEDIR "/%s/cache/%s"
-
 struct btd_disconnect_data {
 	guint id;
 	disconnect_watch watch;
@@ -231,7 +228,8 @@ static gboolean store_device_info_cb(gpointer user_data)
 
 	ba2str(adapter_get_address(device->adapter), adapter_addr);
 	ba2str(&device->bdaddr, device_addr);
-	snprintf(filename, PATH_MAX, INFO_PATH, adapter_addr, device_addr);
+	snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", adapter_addr,
+			device_addr);
 	filename[PATH_MAX] = '\0';
 
 	create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
@@ -1693,7 +1691,7 @@ static char *load_cached_name(struct btd_device *device, const char *local,
 	char *str = NULL;
 	int len;
 
-	snprintf(filename, PATH_MAX, CACHE_PATH, local, peer);
+	snprintf(filename, PATH_MAX, STORAGEDIR "/%s/cache/%s", local, peer);
 	filename[PATH_MAX] = '\0';
 
 	key_file = g_key_file_new();
@@ -1722,7 +1720,7 @@ static void load_info(struct btd_device *device, const gchar *local,
 	char *str;
 	gboolean store_needed = FALSE;
 
-	snprintf(filename, PATH_MAX, INFO_PATH, local, peer);
+	snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", local, peer);
 	filename[PATH_MAX] = '\0';
 
 	key_file = g_key_file_new();
-- 
1.7.9.5


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

end of thread, other threads:[~2012-11-16  8:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-15 17:31 [PATCH 1/8] device: Remove storage path #defines Frédéric Danis
2012-11-15 17:31 ` [PATCH 2/8] device: Device_remove_stored removes device directory Frédéric Danis
2012-11-15 17:31 ` [PATCH 3/8] adapter: Convert storage classes Frédéric Danis
2012-11-15 17:31 ` [PATCH 4/8] device: Retrieve class from storage Frédéric Danis
2012-11-15 17:31 ` [PATCH 5/8] adapter: Set device class in device object Frédéric Danis
2012-11-15 17:31 ` [PATCH 6/8] event: " Frédéric Danis
2012-11-15 17:31 ` [PATCH 7/8] dbusoob: " Frédéric Danis
2012-11-15 17:31 ` [PATCH 8/8] neard: " Frédéric Danis
2012-11-16  8:24   ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).