From de73a0cfdfe4e175b12da1cf38dd5d3f7c1b8d9a Mon Sep 17 00:00:00 2001 From: OPPO Date: Fri, 28 Mar 2014 19:12:47 +0800 Subject: [PATCH] Sync persist property immediately,in case of suddenly remove the battery. Change-Id: I83c5812c69db532f4675f5dbfa508e55999c8dfe --- init/property_service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/init/property_service.c b/init/property_service.c index fe7cbb582..eb19f93a7 100644 --- a/init/property_service.c +++ b/init/property_service.c @@ -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);