Use the default logic when not using INS
[platform/upstream/connman.git] / src / stats.c
old mode 100644 (file)
new mode 100755 (executable)
index 663bc38..1df41f1
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <errno.h>
 #include <sys/mman.h>
 #include <sys/types.h>
@@ -54,7 +53,7 @@
  *
  * File properties:
  *   The ring buffer is mmap to a file
- *   Initialy only the smallest possible amount of disk space is allocated
+ *   Initially only the smallest possible amount of disk space is allocated
  *   The files grow to the configured maximal size
  *   The grows by _SC_PAGESIZE step size
  *   For each service a file is created
@@ -81,8 +80,8 @@
  *
  * History file:
  *   Same format as the ring buffer file
- *   For a period of at least 2 months dayly records are keept
- *   If older, then only a monthly record is keept
+ *   For a period of at least 2 months daily records are kept
+ *   If older, then only a monthly record is kept
  */
 
 
@@ -349,7 +348,7 @@ static int stats_open_temp(struct stats_file *file)
                                        STORAGEDIR);
        file->fd = g_mkstemp_full(file->name, O_RDWR | O_CREAT, 0644);
        if (file->fd < 0) {
-               connman_error("create tempory file error %s for %s",
+               connman_error("create temporary file error %s for %s",
                                strerror(errno), file->name);
                g_free(file->name);
                file->name = NULL;
@@ -678,7 +677,7 @@ int __connman_stats_service_register(struct connman_service *service)
        DBG("service %p", service);
 
        dir = g_strdup_printf("%s/%s", STORAGEDIR,
-                               __connman_service_get_ident(service));
+                               connman_service_get_identifier(service));
 
        /* If the dir doesn't exist, create it */
        if (!g_file_test(dir, G_FILE_TEST_IS_DIR)) {
@@ -707,9 +706,9 @@ int __connman_stats_service_register(struct connman_service *service)
        }
 
        name = g_strdup_printf("%s/%s/data", STORAGEDIR,
-                               __connman_service_get_ident(service));
+                               connman_service_get_identifier(service));
        file->history_name = g_strdup_printf("%s/%s/history", STORAGEDIR,
-                               __connman_service_get_ident(service));
+                               connman_service_get_identifier(service));
 
        /* TODO: Use a global config file instead of hard coded value. */
        file->account_period_offset = 1;