From: Daniel Wagner <[email protected]>
---
src/main.c | 6 ++++++
src/stats.c | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/main.c b/src/main.c
index 28e72ba..0574a4f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -172,6 +172,12 @@ int main(int argc, char *argv[])
perror("Failed to create storage directory");
}
+ if (mkdir(STORAGEDIR "/stats", S_IRUSR | S_IWUSR | S_IXUSR |
+ S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) < 0) {
+ if (errno != EEXIST)
+ perror("Failed to create statistic storage directory");
+ }
+
old_umask = umask(077);
main_loop = g_main_loop_new(NULL, FALSE);
diff --git a/src/stats.c b/src/stats.c
index 9e14021..2e3a396 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -258,10 +258,10 @@ static int stats_open_file(struct connman_service
*service,
connman_bool_t new_file = FALSE;
if (roaming == FALSE) {
- name = g_strdup_printf("%s/%s.data", STORAGEDIR,
+ name = g_strdup_printf("%s/stats/%s.data", STORAGEDIR,
__connman_service_get_ident(service));
} else {
- name = g_strdup_printf("%s/%s-roaming.data", STORAGEDIR,
+ name = g_strdup_printf("%s/stats/%s-roaming.data", STORAGEDIR,
__connman_service_get_ident(service));
}
--
1.7.2.2
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman