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 statistics directory");
+ }
+
old_umask = umask(077);
main_loop = g_main_loop_new(NULL, FALSE);
struct stats_file_header *hdr;
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));
}