am e2fb764c: am 36ccca15: Merge "toolbox: turn on -Werror"

* commit 'e2fb764c3b1c3285bbc78f5e9a0c70785d2383f5':
  toolbox: turn on -Werror
This commit is contained in:
Mark Salyzyn 2014-05-21 15:46:39 +00:00 committed by Android Git Automerger
commit faf845290b
27 changed files with 58 additions and 84 deletions

View file

@ -96,7 +96,7 @@ LOCAL_C_INCLUDES := bionic/libc/bionic
LOCAL_CFLAGS += \ LOCAL_CFLAGS += \
-std=gnu99 \ -std=gnu99 \
-Wno-unused-parameter \ -Werror -Wno-unused-parameter \
-include bsd-compatibility.h \ -include bsd-compatibility.h \
LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \

View file

@ -95,12 +95,14 @@ enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
static int copy(char *[], enum op, int); static int copy(char *[], enum op, int);
#ifndef ANDROID
static void static void
progress(int sig __unused) progress(int sig __unused)
{ {
pinfo++; pinfo++;
} }
#endif
int int
cp_main(int argc, char *argv[]) cp_main(int argc, char *argv[])

View file

@ -380,10 +380,11 @@ copy_special(struct stat *from_stat, int exists)
int int
setfile(struct stat *fs, int fd) setfile(struct stat *fs, int fd)
{ {
int rval, islink; int rval = 0;
#ifndef ANDROID
int islink = S_ISLNK(fs->st_mode);
#endif
rval = 0;
islink = S_ISLNK(fs->st_mode);
fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO; fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO;
/* /*
@ -401,13 +402,13 @@ setfile(struct stat *fs, int fd)
fs->st_mode &= ~(S_ISUID | S_ISGID); fs->st_mode &= ~(S_ISUID | S_ISGID);
} }
#ifdef ANDROID #ifdef ANDROID
if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) { if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) {
#else #else
if (fd ? fchmod(fd, fs->st_mode) : lchmod(to.p_path, fs->st_mode)) { if (fd ? fchmod(fd, fs->st_mode) : lchmod(to.p_path, fs->st_mode)) {
#endif #endif
warn("chmod: %s", to.p_path); warn("chmod: %s", to.p_path);
rval = 1; rval = 1;
} }
#ifndef ANDROID #ifndef ANDROID
if (!islink && !Nflag) { if (!islink && !Nflag) {

View file

@ -140,14 +140,12 @@ static char *parse_time(const char *str, struct timeval *ts) {
int date_main(int argc, char *argv[]) int date_main(int argc, char *argv[])
{ {
int c; int c;
int res; int res;
struct tm tm; struct tm tm;
time_t t; time_t t;
struct timeval tv; struct timeval tv;
struct timespec ts; char strbuf[260];
char strbuf[260];
int fd;
int useutc = 0; int useutc = 0;
@ -177,7 +175,6 @@ int date_main(int argc, char *argv[])
int hasfmt = argc == optind + 1 && argv[optind][0] == '+'; int hasfmt = argc == optind + 1 && argv[optind][0] == '+';
if(optind == argc || hasfmt) { if(optind == argc || hasfmt) {
char buf[2000];
time(&t); time(&t);
if (useutc) { if (useutc) {
gmtime_r(&t, &tm); gmtime_r(&t, &tm);

View file

@ -356,7 +356,7 @@ dd_in(void)
++st.in_full; ++st.in_full;
/* Handle full input blocks. */ /* Handle full input blocks. */
} else if (n == in.dbsz) { } else if (n == (int64_t)in.dbsz) {
in.dbcnt += in.dbrcnt = n; in.dbcnt += in.dbrcnt = n;
++st.in_full; ++st.in_full;
@ -521,7 +521,7 @@ dd_out(int force)
outp += nw; outp += nw;
st.bytes += nw; st.bytes += nw;
if (nw == n) { if (nw == n) {
if (n != out.dbsz) if (n != (int64_t)out.dbsz)
++st.out_part; ++st.out_part;
else else
++st.out_full; ++st.out_full;
@ -649,8 +649,8 @@ pos_in(void)
void void
pos_out(void) pos_out(void)
{ {
// struct mtop t_op; /* struct mtop t_op; */
int cnt, n; int64_t cnt, n;
/* /*
* If not a tape, try seeking on the file. Seeking on a pipe is * If not a tape, try seeking on the file. Seeking on a pipe is
@ -681,7 +681,7 @@ pos_out(void)
} }
/* Read it. */ /* Read it. */
for (cnt = 0; cnt < out.offset; ++cnt) { for (cnt = 0; cnt < (int64_t)out.offset; ++cnt) {
if ((n = read(out.fd, out.db, out.dbsz)) > 0) if ((n = read(out.fd, out.db, out.dbsz)) > 0)
continue; continue;
@ -705,8 +705,8 @@ pos_out(void)
/* NOTREACHED */ /* NOTREACHED */
} }
while (cnt++ < out.offset) while (cnt++ < (int64_t)out.offset)
if ((n = bwrite(out.fd, out.db, out.dbsz)) != out.dbsz) { if ((n = bwrite(out.fd, out.db, out.dbsz)) != (int64_t)out.dbsz) {
fprintf(stderr, "%s: cannot position " fprintf(stderr, "%s: cannot position "
"by writing: %s\n", "by writing: %s\n",
out.name, strerror(errno)); out.name, strerror(errno));
@ -1153,7 +1153,7 @@ c_arg(const void *a, const void *b)
((const struct arg *)b)->name)); ((const struct arg *)b)->name));
} }
static long long strsuftoll(const char* name, const char* arg, int def, unsigned int max) static long long strsuftoll(const char* name, const char* arg, int def, unsigned long long max)
{ {
long long result; long long result;
@ -1180,7 +1180,7 @@ static void
f_count(char *arg) f_count(char *arg)
{ {
cpy_cnt = strsuftoll("block count", arg, 0, LLONG_MAX); cpy_cnt = (uint64_t)strsuftoll("block count", arg, 0, 0xFFFFFFFFFFFFFFFFULL);
if (!cpy_cnt) if (!cpy_cnt)
terminate(0); terminate(0);
} }
@ -1228,14 +1228,14 @@ static void
f_seek(char *arg) f_seek(char *arg)
{ {
out.offset = strsuftoll("seek blocks", arg, 0, LLONG_MAX); out.offset = (uint64_t)strsuftoll("seek blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL);
} }
static void static void
f_skip(char *arg) f_skip(char *arg)
{ {
in.offset = strsuftoll("skip blocks", arg, 0, LLONG_MAX); in.offset = (uint64_t)strsuftoll("skip blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL);
} }
static void static void

View file

@ -76,7 +76,7 @@ du_main(int argc, char *argv[])
int64_t totalblocks; int64_t totalblocks;
int ftsoptions, listfiles; int ftsoptions, listfiles;
int depth; int depth;
int Hflag, Lflag, aflag, ch, cflag, dflag, gkmflag, nflag, rval, sflag; int Hflag, Lflag, aflag, ch, cflag, dflag, gkmflag, rval, sflag;
const char *noargv[2]; const char *noargv[2];
Hflag = Lflag = aflag = cflag = dflag = gkmflag = sflag = 0; Hflag = Lflag = aflag = cflag = dflag = gkmflag = sflag = 0;

View file

@ -492,13 +492,11 @@ int getevent_main(int argc, char *argv[])
int c; int c;
int i; int i;
int res; int res;
int pollres;
int get_time = 0; int get_time = 0;
int print_device = 0; int print_device = 0;
char *newline = "\n"; char *newline = "\n";
uint16_t get_switch = 0; uint16_t get_switch = 0;
struct input_event event; struct input_event event;
int version;
int print_flags = 0; int print_flags = 0;
int print_flags_set = 0; int print_flags_set = 0;
int dont_block = -1; int dont_block = -1;
@ -629,7 +627,8 @@ int getevent_main(int argc, char *argv[])
return 0; return 0;
while(1) { while(1) {
pollres = poll(ufds, nfds, -1); //int pollres =
poll(ufds, nfds, -1);
//printf("poll %d, returned %d\n", nfds, pollres); //printf("poll %d, returned %d\n", nfds, pollres);
if(ufds[0].revents & POLLIN) { if(ufds[0].revents & POLLIN) {
read_notify(device_path, ufds[0].fd, print_flags); read_notify(device_path, ufds[0].fd, print_flags);

View file

@ -652,6 +652,7 @@ static struct label snd_labels[] = {
LABEL_END, LABEL_END,
}; };
#if 0
static struct label id_labels[] = { static struct label id_labels[] = {
LABEL(ID_BUS), LABEL(ID_BUS),
LABEL(ID_VENDOR), LABEL(ID_VENDOR),
@ -682,6 +683,7 @@ static struct label bus_labels[] = {
LABEL(BUS_SPI), LABEL(BUS_SPI),
LABEL_END, LABEL_END,
}; };
#endif
static struct label mt_tool_labels[] = { static struct label mt_tool_labels[] = {
LABEL(MT_TOOL_FINGER), LABEL(MT_TOOL_FINGER),

View file

@ -32,8 +32,6 @@ static void list_properties(void)
int getprop_main(int argc, char *argv[]) int getprop_main(int argc, char *argv[])
{ {
int n = 0;
if (argc == 1) { if (argc == 1) {
list_properties(); list_properties();
} else { } else {

View file

@ -78,7 +78,9 @@ static inline int
grep_refill(struct file *f) grep_refill(struct file *f)
{ {
ssize_t nr; ssize_t nr;
#ifndef ANDROID
int bzerr; int bzerr;
#endif
bufpos = buffer; bufpos = buffer;
bufrem = 0; bufrem = 0;

View file

@ -403,7 +403,7 @@ grep_main(int argc, char *argv[])
Aflag = 0; Aflag = 0;
else if (Aflag > LLONG_MAX / 10) { else if (Aflag > LLONG_MAX / 10) {
errno = ERANGE; errno = ERANGE;
err(2, NULL); err(2, "%llu", Aflag);
} }
Aflag = Bflag = (Aflag * 10) + (c - '0'); Aflag = Bflag = (Aflag * 10) + (c - '0');
break; break;
@ -420,10 +420,10 @@ grep_main(int argc, char *argv[])
l = strtoull(optarg, &ep, 10); l = strtoull(optarg, &ep, 10);
if (((errno == ERANGE) && (l == ULLONG_MAX)) || if (((errno == ERANGE) && (l == ULLONG_MAX)) ||
((errno == EINVAL) && (l == 0))) ((errno == EINVAL) && (l == 0)))
err(2, NULL); err(2, "strtoull");
else if (ep[0] != '\0') { else if (ep[0] != '\0') {
errno = EINVAL; errno = EINVAL;
err(2, NULL); err(2, "empty");
} }
if (c == 'A') if (c == 'A')
Aflag = l; Aflag = l;
@ -509,10 +509,10 @@ grep_main(int argc, char *argv[])
mcount = strtoull(optarg, &ep, 10); mcount = strtoull(optarg, &ep, 10);
if (((errno == ERANGE) && (mcount == ULLONG_MAX)) || if (((errno == ERANGE) && (mcount == ULLONG_MAX)) ||
((errno == EINVAL) && (mcount == 0))) ((errno == EINVAL) && (mcount == 0)))
err(2, NULL); err(2, "strtoull");
else if (ep[0] != '\0') { else if (ep[0] != '\0') {
errno = EINVAL; errno = EINVAL;
err(2, NULL); err(2, "empty");
} }
break; break;
case 'n': case 'n':

View file

@ -14,7 +14,6 @@ int hd_main(int argc, char *argv[])
unsigned char buf[4096]; unsigned char buf[4096];
int res; int res;
int read_len; int read_len;
int rv = 0;
int i; int i;
int filepos = 0; int filepos = 0;
int sum; int sum;

View file

@ -21,9 +21,9 @@ int ioctl_main(int argc, char *argv[])
int arg_size = 4; int arg_size = 4;
int direct_arg = 0; int direct_arg = 0;
uint32_t ioctl_nr; uint32_t ioctl_nr;
void *ioctl_args; void *ioctl_args = NULL;
uint8_t *ioctl_argp; uint8_t *ioctl_argp;
uint8_t *ioctl_argp_save; uint8_t *ioctl_argp_save = NULL;
int rem; int rem;
do { do {
@ -112,6 +112,7 @@ int ioctl_main(int argc, char *argv[])
else else
res = ioctl(fd, ioctl_nr, 0); res = ioctl(fd, ioctl_nr, 0);
if (res < 0) { if (res < 0) {
free(ioctl_args);
fprintf(stderr, "ioctl 0x%x failed, %d\n", ioctl_nr, res); fprintf(stderr, "ioctl 0x%x failed, %d\n", ioctl_nr, res);
return 1; return 1;
} }
@ -124,5 +125,6 @@ int ioctl_main(int argc, char *argv[])
} }
printf("\n"); printf("\n");
} }
free(ioctl_args);
return 0; return 0;
} }

View file

@ -10,7 +10,7 @@
int load_policy_main(int argc, char **argv) int load_policy_main(int argc, char **argv)
{ {
int fd, rc, vers; int fd, rc;
struct stat sb; struct stat sb;
void *map; void *map;
const char *path; const char *path;

View file

@ -443,7 +443,6 @@ static int listpath(const char *name, int flags)
int ls_main(int argc, char **argv) int ls_main(int argc, char **argv)
{ {
int flags = 0; int flags = 0;
int listed = 0;
if(argc > 1) { if(argc > 1) {
int i; int i;

View file

@ -99,10 +99,7 @@ out:
static void print_maps(struct pid_info_t* info) static void print_maps(struct pid_info_t* info)
{ {
FILE *maps; FILE *maps;
char buffer[PATH_MAX + 100];
size_t offset; size_t offset;
int major, minor;
char device[10]; char device[10];
long int inode; long int inode;
char file[PATH_MAX]; char file[PATH_MAX];

View file

@ -15,7 +15,6 @@ static int usage()
int mkdir_main(int argc, char *argv[]) int mkdir_main(int argc, char *argv[])
{ {
int symbolic = 0;
int ret; int ret;
if(argc < 2 || strcmp(argv[1], "--help") == 0) { if(argc < 2 || strcmp(argv[1], "--help") == 0) {
return usage(); return usage();

View file

@ -360,7 +360,7 @@ newfs_msdos_main(int argc, char *argv[])
if (!opt_create && !strchr(fname, '/')) { if (!opt_create && !strchr(fname, '/')) {
snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
if (!(fname = strdup(buf))) if (!(fname = strdup(buf)))
err(1, NULL); err(1, "%s", buf);
} }
dtype = *argv; dtype = *argv;
if (opt_create) { if (opt_create) {
@ -493,7 +493,7 @@ newfs_msdos_main(int argc, char *argv[])
if (!strchr(bname, '/')) { if (!strchr(bname, '/')) {
snprintf(buf, sizeof(buf), "/boot/%s", bname); snprintf(buf, sizeof(buf), "/boot/%s", bname);
if (!(bname = strdup(buf))) if (!(bname = strdup(buf)))
err(1, NULL); err(1, "%s", buf);
} }
if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb))
err(1, "%s", bname); err(1, "%s", bname);
@ -611,7 +611,7 @@ newfs_msdos_main(int argc, char *argv[])
now = tv.tv_sec; now = tv.tv_sec;
tm = localtime(&now); tm = localtime(&now);
if (!(img = malloc(bpb.bps))) if (!(img = malloc(bpb.bps)))
err(1, NULL); err(1, "%u", bpb.bps);
dir = bpb.res + (bpb.spf ? bpb.spf : bpb.bspf) * bpb.nft; dir = bpb.res + (bpb.spf ? bpb.spf : bpb.bspf) * bpb.nft;
for (lsn = 0; lsn < dir + (fat == 32 ? bpb.spc : rds); lsn++) { for (lsn = 0; lsn < dir + (fat == 32 ? bpb.spc : rds); lsn++) {
x = lsn; x = lsn;
@ -728,14 +728,14 @@ newfs_msdos_main(int argc, char *argv[])
static void static void
check_mounted(const char *fname, mode_t mode) check_mounted(const char *fname, mode_t mode)
{ {
#ifdef ANDROID
warnx("Skipping mount checks");
#else
struct statfs *mp; struct statfs *mp;
const char *s1, *s2; const char *s1, *s2;
size_t len; size_t len;
int n, r; int n, r;
#ifdef ANDROID
warnx("Skipping mount checks");
#else
if (!(n = getmntinfo(&mp, MNT_NOWAIT))) if (!(n = getmntinfo(&mp, MNT_NOWAIT)))
err(1, "getmntinfo"); err(1, "getmntinfo");
len = strlen(_PATH_DEV); len = strlen(_PATH_DEV);

View file

@ -43,7 +43,7 @@ static int ps_line(int pid, int tid, char *namefilter)
struct stat stats; struct stat stats;
int fd, r; int fd, r;
char *ptr, *name, *state; char *ptr, *name, *state;
int ppid, tty; int ppid;
unsigned wchan, rss, vss, eip; unsigned wchan, rss, vss, eip;
unsigned utime, stime; unsigned utime, stime;
int prio, nice, rtprio, sched, psr; int prio, nice, rtprio, sched, psr;
@ -91,7 +91,7 @@ static int ps_line(int pid, int tid, char *namefilter)
ppid = atoi(nexttok(&ptr)); ppid = atoi(nexttok(&ptr));
nexttok(&ptr); // pgrp nexttok(&ptr); // pgrp
nexttok(&ptr); // sid nexttok(&ptr); // sid
tty = atoi(nexttok(&ptr)); nexttok(&ptr); // tty
nexttok(&ptr); // tpgid nexttok(&ptr); // tpgid
nexttok(&ptr); // flags nexttok(&ptr); // flags
@ -133,7 +133,7 @@ static int ps_line(int pid, int tid, char *namefilter)
rtprio = atoi(nexttok(&ptr)); // rt_priority rtprio = atoi(nexttok(&ptr)); // rt_priority
sched = atoi(nexttok(&ptr)); // scheduling policy sched = atoi(nexttok(&ptr)); // scheduling policy
tty = atoi(nexttok(&ptr)); nexttok(&ptr); // tty
if(tid != 0) { if(tid != 0) {
ppid = pid; ppid = pid;

View file

@ -11,7 +11,6 @@ static int usage()
int rmdir_main(int argc, char *argv[]) int rmdir_main(int argc, char *argv[])
{ {
int symbolic = 0;
int ret; int ret;
if(argc < 2) return usage(); if(argc < 2) return usage();

View file

@ -227,7 +227,6 @@ static void update_table(DIR *d, uint32_t flags)
} }
for (i = 0; i < last_processes.active; i++) { for (i = 0; i < last_processes.active; i++) {
int pid = last_processes.data[i].pid; int pid = last_processes.data[i].pid;
int tid = last_processes.data[i].tid;
for (j = 0; j < processes.active; j++) for (j = 0; j < processes.active; j++)
if (pid == processes.data[j].pid) if (pid == processes.data[j].pid)
break; break;
@ -270,9 +269,6 @@ int schedtop_main(int argc, char **argv)
{ {
int c; int c;
DIR *d; DIR *d;
struct dirent *de;
char *namefilter = 0;
int pidfilter = 0;
uint32_t flags = 0; uint32_t flags = 0;
int delay = 3000000; int delay = 3000000;
float delay_f; float delay_f;

View file

@ -47,9 +47,8 @@ struct input_event {
int sendevent_main(int argc, char *argv[]) int sendevent_main(int argc, char *argv[])
{ {
int i;
int fd; int fd;
int ret; ssize_t ret;
int version; int version;
struct input_event event; struct input_event event;
@ -72,7 +71,7 @@ int sendevent_main(int argc, char *argv[])
event.code = atoi(argv[3]); event.code = atoi(argv[3]);
event.value = atoi(argv[4]); event.value = atoi(argv[4]);
ret = write(fd, &event, sizeof(event)); ret = write(fd, &event, sizeof(event));
if(ret < sizeof(event)) { if(ret < (ssize_t) sizeof(event)) {
fprintf(stderr, "write event failed, %s\n", strerror(errno)); fprintf(stderr, "write event failed, %s\n", strerror(errno));
return -1; return -1;
} }

View file

@ -7,8 +7,6 @@
int start_main(int argc, char *argv[]) int start_main(int argc, char *argv[])
{ {
char buf[1024];
if(argc > 1) { if(argc > 1) {
property_set("ctl.start", argv[1]); property_set("ctl.start", argv[1]);
} else { } else {

View file

@ -5,8 +5,6 @@
int stop_main(int argc, char *argv[]) int stop_main(int argc, char *argv[])
{ {
char buf[1024];
if(argc > 1) { if(argc > 1) {
property_set("ctl.stop", argv[1]); property_set("ctl.stop", argv[1]);
} else{ } else{

View file

@ -328,7 +328,6 @@ static void read_procs(void) {
static int read_stat(char *filename, struct proc_info *proc) { static int read_stat(char *filename, struct proc_info *proc) {
FILE *file; FILE *file;
char buf[MAX_LINE], *open_paren, *close_paren; char buf[MAX_LINE], *open_paren, *close_paren;
int res, idx;
file = fopen(filename, "r"); file = fopen(filename, "r");
if (!file) return 1; if (!file) return 1;
@ -414,9 +413,7 @@ static void print_procs(void) {
struct proc_info *old_proc, *proc; struct proc_info *old_proc, *proc;
long unsigned total_delta_time; long unsigned total_delta_time;
struct passwd *user; struct passwd *user;
struct group *group;
char *user_str, user_buf[20]; char *user_str, user_buf[20];
char *group_str, group_buf[20];
for (i = 0; i < num_new_procs; i++) { for (i = 0; i < num_new_procs; i++) {
if (new_procs[i]) { if (new_procs[i]) {
@ -467,19 +464,12 @@ static void print_procs(void) {
if (!proc || (max_procs && (i >= max_procs))) if (!proc || (max_procs && (i >= max_procs)))
break; break;
user = getpwuid(proc->uid); user = getpwuid(proc->uid);
group = getgrgid(proc->gid);
if (user && user->pw_name) { if (user && user->pw_name) {
user_str = user->pw_name; user_str = user->pw_name;
} else { } else {
snprintf(user_buf, 20, "%d", proc->uid); snprintf(user_buf, 20, "%d", proc->uid);
user_str = user_buf; user_str = user_buf;
} }
if (group && group->gr_name) {
group_str = group->gr_name;
} else {
snprintf(group_buf, 20, "%d", proc->gid);
group_str = group_buf;
}
if (!threads) if (!threads)
printf("%5d %2d %3ld%% %c %5d %6ldK %6ldK %3s %-8.8s %s\n", proc->pid, proc->prs, proc->delta_time * 100 / total_delta_time, proc->state, proc->num_threads, printf("%5d %2d %3ld%% %c %5d %6ldK %6ldK %3s %-8.8s %s\n", proc->pid, proc->prs, proc->delta_time * 100 / total_delta_time, proc->state, proc->num_threads,
proc->vss / 1024, proc->rss * getpagesize() / 1024, proc->policy, user_str, proc->name[0] != 0 ? proc->name : proc->tname); proc->vss / 1024, proc->rss * getpagesize() / 1024, proc->policy, user_str, proc->name[0] != 0 ? proc->name : proc->tname);

View file

@ -33,7 +33,6 @@ static int is_loop_mount(const char* path, char *loopdev)
char mount_path[256]; char mount_path[256];
char rest[256]; char rest[256];
int result = 0; int result = 0;
int path_length = strlen(path);
f = fopen("/proc/mounts", "r"); f = fopen("/proc/mounts", "r");
if (!f) { if (!f) {

View file

@ -77,9 +77,7 @@ static void update_watchlist(const prop_info *pi, void *cookie)
int watchprops_main(int argc, char *argv[]) int watchprops_main(int argc, char *argv[])
{ {
unsigned serial = 0; unsigned serial;
unsigned count = 0;
unsigned n;
Hashmap *watchlist = hashmapCreate(1024, str_hash, str_equals); Hashmap *watchlist = hashmapCreate(1024, str_hash, str_equals);
if (!watchlist) if (!watchlist)
@ -87,7 +85,7 @@ int watchprops_main(int argc, char *argv[])
__system_property_foreach(populate_watchlist, watchlist); __system_property_foreach(populate_watchlist, watchlist);
for(;;) { for(serial = 0;;) {
serial = __system_property_wait_any(serial); serial = __system_property_wait_any(serial);
__system_property_foreach(update_watchlist, watchlist); __system_property_foreach(update_watchlist, watchlist);
} }