Add basic error checking to legacy property init
Let init and rename funcitons return success or failure values.
Change-Id: Ieed86cac8a0dcfd770a89dacc57fd306e7a6ad8d
diff --git a/legacy_property_service.c b/legacy_property_service.c
index 0dc95ad..12865c4 100644
--- a/legacy_property_service.c
+++ b/legacy_property_service.c
@@ -33,13 +33,11 @@
#include <sys/atomics.h>
#include "legacy_property_service.h"
-
static int persistent_properties_loaded = 0;
static int property_area_inited = 0;
static int property_set_fd = -1;
-
typedef struct {
void *data;
size_t size;
@@ -203,9 +201,13 @@
legacy_property_set(key, value);
}
-void legacy_properties_init()
+int legacy_properties_init()
{
- init_property_area();
- property_list(copy_property_to_legacy, 0);
-}
+ if(init_property_area() != 0)
+ return -1;
+ if(property_list(copy_property_to_legacy, 0) != 0)
+ return -1;
+
+ return 0;
+}