summaryrefslogtreecommitdiff
path: root/libc/netbsd/resolv/res_state.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-01-23 23:07:06 -0800
committerColin Cross <ccross@android.com>2013-06-17 16:58:43 -0700
commit5cf32de7a0fea0b10959b598300babc6e4f54d95 (patch)
treec0f130185003fff9bf8cc00f96a3a04475535b3f /libc/netbsd/resolv/res_state.c
parent5995bf880e2a7fac249382f0a929b7271c843122 (diff)
bionic: move system property writing from init to bionic
Move the implementation of writing to the system property area from init to bionic, next to the reader implementation. This will allow full property testing to be added to bionic tests. Add new accessor and waiting functions to hide the implementation from watchprops and various bionic users. Also hide some of the implementation details of the property area from init by moving them into _system_properties.h, and other details from everybody by moving them into system_properties.h. (cherry picked from commit dc1038b7900acb664e99643d2974e1a0f4703781) Change-Id: I192d3825ee276c5047bc751039fe6cfe226a7cca
Diffstat (limited to 'libc/netbsd/resolv/res_state.c')
-rw-r--r--libc/netbsd/resolv/res_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/netbsd/resolv/res_state.c b/libc/netbsd/resolv/res_state.c
index 3e1f67b82..2b34867f7 100644
--- a/libc/netbsd/resolv/res_state.c
+++ b/libc/netbsd/resolv/res_state.c
@@ -71,7 +71,7 @@ _res_thread_alloc(void)
rt->_serial = 0;
rt->_pi = (struct prop_info*) __system_property_find("net.change");
if (rt->_pi) {
- rt->_serial = rt->_pi->serial;
+ rt->_serial = __system_property_serial(rt->_pi);
}
memset(rt->_rstatic, 0, sizeof rt->_rstatic);
}
@@ -135,14 +135,14 @@ _res_thread_get(void)
return rt;
}
}
- if (rt->_serial == rt->_pi->serial) {
+ if (rt->_serial == __system_property_serial(rt->_pi)) {
/* Nothing changed, so return the current state */
D("%s: tid=%d rt=%p nothing changed, returning",
__FUNCTION__, gettid(), rt);
return rt;
}
/* Update the recorded serial number, and go reset the state */
- rt->_serial = rt->_pi->serial;
+ rt->_serial = __system_property_serial(rt->_pi);
goto RESET_STATE;
}