diff options
| author | Colin Cross <ccross@android.com> | 2013-06-24 17:19:43 -0700 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2013-06-24 17:19:43 -0700 |
| commit | b1a9f8cf4b15a861ab998a4c5f0c69068f22c62a (patch) | |
| tree | 747a6b8891d0c685d805a9c254760a46800adccb | |
| parent | 39021a48a0e0687c654423acd5a4c99a1d79440d (diff) | |
| parent | b6c602859496e212db78435e2b05ec9418189d6c (diff) | |
| download | system_core-b1a9f8cf4b15a861ab998a4c5f0c69068f22c62a.zip system_core-b1a9f8cf4b15a861ab998a4c5f0c69068f22c62a.tar.gz system_core-b1a9f8cf4b15a861ab998a4c5f0c69068f22c62a.tar.bz2 | |
resolved conflicts for merge of b6c60285 to stage-aosp-master
Change-Id: I5afba55b668065499fa28369cf217d4f5eafab4a
| -rwxr-xr-x | init/property_service.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/init/property_service.c b/init/property_service.c index 88348bd..6c71807 100755 --- a/init/property_service.c +++ b/init/property_service.c @@ -111,7 +111,6 @@ struct { }; typedef struct { - void *data; size_t size; int fd; } workspace; @@ -119,36 +118,13 @@ typedef struct { static int init_workspace(workspace *w, size_t size) { void *data; - int fd; - - /* dev is a tmpfs that we can use to carve a shared workspace - * out of, so let's do that... - */ - fd = open(PROP_FILENAME, O_RDWR | O_CREAT | O_NOFOLLOW, 0644); - if (fd < 0) - return -1; - - if (ftruncate(fd, size) < 0) - goto out; - - data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); - if(data == MAP_FAILED) - goto out; - - close(fd); - - fd = open(PROP_FILENAME, O_RDONLY | O_NOFOLLOW); + int fd = open(PROP_FILENAME, O_RDONLY | O_NOFOLLOW); if (fd < 0) return -1; - w->data = data; w->size = size; w->fd = fd; return 0; - -out: - close(fd); - return -1; } static workspace pa_workspace; @@ -158,12 +134,13 @@ static int init_property_area(void) if (property_area_inited) return -1; - if(init_workspace(&pa_workspace, PA_SIZE)) + if(__system_property_area_init()) return -1; - fcntl(pa_workspace.fd, F_SETFD, FD_CLOEXEC); + if(init_workspace(&pa_workspace, 0)) + return -1; - __system_property_area_init(pa_workspace.data); + fcntl(pa_workspace.fd, F_SETFD, FD_CLOEXEC); property_area_inited = 1; return 0; |
