Save counter values during shutdown
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 8 Jul 2010 09:11:11 +0000 (11:11 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 8 Jul 2010 12:56:00 +0000 (14:56 +0200)
With moving the start/stop function to the lower_up/lower_down
fucntions in service, the statistic was not stored anymore
when connman was shutdown. Reason being that lower_down will
be called only from a RTNL event which is asynchron. So when
the ethernet_disable is called connman doesn't see the
corresponding UP,LOWER_UP event.

src/service.c

index c2c2bc3..3027cc8 100644 (file)
@@ -1673,6 +1673,9 @@ static void service_free(gpointer user_data)
 
        g_hash_table_remove(service_hash, service->identifier);
 
+       __connman_service_stats_stop(service);
+       __connman_storage_save_service(service);
+
        service->path = NULL;
 
        if (path != NULL) {