OSDN Git Service

DO NOT MERGE ANYWHERE Sync filesystem after saving a backup of the config file.
authorSharvil Nanavati <sharvil@google.com>
Tue, 1 Mar 2016 02:13:49 +0000 (18:13 -0800)
committerSharvil Nanavati <sharvil@google.com>
Tue, 1 Mar 2016 02:13:49 +0000 (18:13 -0800)
Bug: 27292025
Change-Id: Ied3f84157f491dcdf416de211ffbdb45b2abd529

btif/src/btif_config.c

index 892970a..d699809 100644 (file)
@@ -23,6 +23,7 @@
 #include <pthread.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 
 #include "osi/include/alarm.h"
 #include "osi/include/allocator.h"
@@ -398,6 +399,7 @@ static void btif_config_write(void) {
 
   pthread_mutex_lock(&lock);
   rename(CONFIG_FILE_PATH, CONFIG_BACKUP_PATH);
+  sync();
   config_save(config, CONFIG_FILE_PATH);
   pthread_mutex_unlock(&lock);
 }