summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2011-03-30 12:39:56 -0700
committerBrad Fitzpatrick <bradfitz@android.com>2011-03-30 14:18:25 -0700
commit8ec49049da42e4a987213ec9b0a19a7f907951f8 (patch)
treedb1f77b713bb26f17f20efc0296d5ff878323f83 /init
parentb40367e7bc3f89c3875d50b29fa98c3a541e33a3 (diff)
downloadcore-8ec49049da42e4a987213ec9b0a19a7f907951f8.tar.gz
core-8ec49049da42e4a987213ec9b0a19a7f907951f8.tar.bz2
core-8ec49049da42e4a987213ec9b0a19a7f907951f8.zip
Close the property socket *after* updating properties.
Also remove some dead code. Bionic update is in change I3e80cecf Bug: 4185486 Change-Id: I8dd685eaea1a927c1659df5a1228cc259227ad1c
Diffstat (limited to 'init')
-rw-r--r--init/property_service.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/init/property_service.c b/init/property_service.c
index be56a193f..7fc4f655c 100644
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -189,15 +189,6 @@ static void update_prop_info(prop_info *pi, const char *value, unsigned len)
__futex_wake(&pi->serial, INT32_MAX);
}
-static int property_write(prop_info *pi, const char *value)
-{
- int valuelen = strlen(value);
- if(valuelen >= PROP_VALUE_MAX) return -1;
- update_prop_info(pi, value, valuelen);
- return 0;
-}
-
-
/*
* Checks permissions for starting/stoping system services.
* AID_SYSTEM and AID_ROOT are always allowed.
@@ -384,8 +375,8 @@ void handle_property_set_fd()
}
r = recv(s, &msg, sizeof(msg), 0);
- close(s);
if(r != sizeof(prop_msg)) {
+ close(s);
ERROR("sys_prop: mis-match msg size recieved: %d expected: %d\n",
r, sizeof(prop_msg));
return;
@@ -416,6 +407,11 @@ void handle_property_set_fd()
default:
break;
}
+
+ // Note: bionic's property client code assumes that the property
+ // server will not close the socket until *AFTER* the property is
+ // written to memory.
+ close(s);
}
void get_property_workspace(int *fd, int *sz)