Sync persist property immediately,in case of suddenly remove the battery.

Change-Id: I83c5812c69db532f4675f5dbfa508e55999c8dfe
This commit is contained in:
OPPO 2014-03-28 19:12:47 +08:00 committed by Jimin Wang
parent 47770b7396
commit de73a0cfdf
1 changed files with 1 additions and 0 deletions

View File

@ -269,6 +269,7 @@ static void write_persistent_property(const char *name, const char *value)
return;
}
write(fd, value, strlen(value));
fsync(fd);
close(fd);
snprintf(path, sizeof(path), "%s/%s", PERSISTENT_PROPERTY_DIR, name);