summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Fitzpatrick2011-03-30 14:39:56 -0500
committerBrad Fitzpatrick2011-03-30 17:27:03 -0500
commit9f1e0e3ae3108086948b74ce58af32df92ff8331 (patch)
treeeb7fc368335f47cff320f3e9cd380d3476ab2371 /init/property_service.c
parent97919656803126c6b28ea6070fc86d124ac4ef4b (diff)
downloadplatform-system-core-9f1e0e3ae3108086948b74ce58af32df92ff8331.tar.gz
platform-system-core-9f1e0e3ae3108086948b74ce58af32df92ff8331.tar.xz
platform-system-core-9f1e0e3ae3108086948b74ce58af32df92ff8331.zip
Close the property socket *after* updating properties.
Also remove some dead code. Bionic update is in change I3e80cecf Bug: 4185486 Change-Id: I28e06197ff7a452c70b89b9fc5e2bcf0d9d54bbe
Diffstat (limited to 'init/property_service.c')
-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)
189 __futex_wake(&pi->serial, INT32_MAX); 189 __futex_wake(&pi->serial, INT32_MAX);
190} 190}
191 191
192static int property_write(prop_info *pi, const char *value)
193{
194 int valuelen = strlen(value);
195 if(valuelen >= PROP_VALUE_MAX) return -1;
196 update_prop_info(pi, value, valuelen);
197 return 0;
198}
199
200
201/* 192/*
202 * Checks permissions for starting/stoping system services. 193 * Checks permissions for starting/stoping system services.
203 * AID_SYSTEM and AID_ROOT are always allowed. 194 * AID_SYSTEM and AID_ROOT are always allowed.
@@ -384,8 +375,8 @@ void handle_property_set_fd()
384 } 375 }
385 376
386 r = recv(s, &msg, sizeof(msg), 0); 377 r = recv(s, &msg, sizeof(msg), 0);
387 close(s);
388 if(r != sizeof(prop_msg)) { 378 if(r != sizeof(prop_msg)) {
379 close(s);
389 ERROR("sys_prop: mis-match msg size recieved: %d expected: %d\n", 380 ERROR("sys_prop: mis-match msg size recieved: %d expected: %d\n",
390 r, sizeof(prop_msg)); 381 r, sizeof(prop_msg));
391 return; 382 return;
@@ -416,6 +407,11 @@ void handle_property_set_fd()
416 default: 407 default:
417 break; 408 break;
418 } 409 }
410
411 // Note: bionic's property client code assumes that the property
412 // server will not close the socket until *AFTER* the property is
413 // written to memory.
414 close(s);
419} 415}
420 416
421void get_property_workspace(int *fd, int *sz) 417void get_property_workspace(int *fd, int *sz)