summaryrefslogtreecommitdiffstats
path: root/toolbox/watchprops.c
diff options
context:
space:
mode:
Diffstat (limited to 'toolbox/watchprops.c')
-rw-r--r--toolbox/watchprops.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/toolbox/watchprops.c b/toolbox/watchprops.c
index bf82882..0d05aba 100644
--- a/toolbox/watchprops.c
+++ b/toolbox/watchprops.c
@@ -6,8 +6,6 @@
#include <cutils/properties.h>
#include <cutils/hashmap.h>
-#include <sys/atomics.h>
-
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
@@ -23,9 +21,9 @@ static bool str_equals(void *keyA, void *keyB)
static void announce(char *name, char *value)
{
- char *x;
+ unsigned char *x;
- for(x = value; *x; x++) {
+ for(x = (unsigned char *)value; *x; x++) {
if((*x < 32) || (*x > 127)) *x = '.';
}
@@ -77,9 +75,7 @@ static void update_watchlist(const prop_info *pi, void *cookie)
int watchprops_main(int argc, char *argv[])
{
- unsigned serial = 0;
- unsigned count = 0;
- unsigned n;
+ unsigned serial;
Hashmap *watchlist = hashmapCreate(1024, str_hash, str_equals);
if (!watchlist)
@@ -87,7 +83,7 @@ int watchprops_main(int argc, char *argv[])
__system_property_foreach(populate_watchlist, watchlist);
- for(;;) {
+ for(serial = 0;;) {
serial = __system_property_wait_any(serial);
__system_property_foreach(update_watchlist, watchlist);
}