diff options
author | Denis Vlasenko | 2008-05-15 21:30:45 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-05-15 21:30:45 +0000 |
commit | 6b06cb80be64fcf207bee734cc678c25434ed1a4 (patch) | |
tree | aebc37ae3a2658fba3f57003102fa0dfb1a10ac8 /procps | |
parent | 43d5d429fd7a80ca02eb8388f058fd9654cc118d (diff) | |
download | busybox-6b06cb80be64fcf207bee734cc678c25434ed1a4.zip busybox-6b06cb80be64fcf207bee734cc678c25434ed1a4.tar.gz |
more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs.
function old new delta
syslogd_main 938 958 +20
get_signum 136 143 +7
obj_load 777 782 +5
recv_from_to 210 214 +4
get_next_block 1795 1799 +4
display_topmem_process_list 1117 1121 +4
logread_main 484 487 +3
buffer_fill_and_print 73 76 +3
kill_main 687 689 +2
ll_remember_index 240 241 +1
do_stats 452 453 +1
if_readconf 166 165 -1
display_process_list 1192 1191 -1
run_applet_and_exit 507 505 -2
print_signames 33 31 -2
parse_one_line 1092 1090 -2
find_out_spec 57 55 -2
add_ksymoops_symbols 421 419 -2
ash_main 1407 1402 -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17) Total: 37 bytes
Diffstat (limited to 'procps')
-rw-r--r-- | procps/kill.c | 9 | ||||
-rw-r--r-- | procps/pgrep.c | 2 | ||||
-rw-r--r-- | procps/pidof.c | 2 | ||||
-rw-r--r-- | procps/ps.c | 2 | ||||
-rw-r--r-- | procps/top.c | 10 |
5 files changed, 12 insertions, 13 deletions
diff --git a/procps/kill.c b/procps/kill.c index b839b38..ed659af 100644 --- a/procps/kill.c +++ b/procps/kill.c @@ -106,19 +106,19 @@ int kill_main(int argc, char **argv) argc--; do_it_now: + pid = getpid(); if (killall5) { pid_t sid; procps_status_t* p = NULL; - /* Now stop all processes */ - kill(-1, SIGSTOP); /* Find out our own session id */ - pid = getpid(); sid = getsid(pid); + /* Now stop all processes */ + kill(-1, SIGSTOP); /* Now kill all processes except our session */ while ((p = procps_scan(p, PSSCAN_PID|PSSCAN_SID))) { - if (p->sid != sid && p->pid != pid && p->pid != 1) + if (p->sid != (unsigned)sid && p->pid != (unsigned)pid && p->pid != 1) kill(p->pid, signo); } /* And let them continue */ @@ -134,7 +134,6 @@ do_it_now: if (killall) { /* Looks like they want to do a killall. Do that */ - pid = getpid(); while (arg) { pid_t* pidList; diff --git a/procps/pgrep.c b/procps/pgrep.c index f20789c..336fa84 100644 --- a/procps/pgrep.c +++ b/procps/pgrep.c @@ -115,7 +115,7 @@ int pgrep_main(int argc ATTRIBUTE_UNUSED, char **argv) cmd = proc->comm; /* NB: OPT_INVERT is always 0 or 1 */ if ((regexec(&re_buffer, cmd, 1, re_match, 0) == 0 /* match found */ - && (!OPT_ANCHOR || (re_match[0].rm_so == 0 && re_match[0].rm_eo == strlen(cmd)))) ^ OPT_INVERT + && (!OPT_ANCHOR || (re_match[0].rm_so == 0 && re_match[0].rm_eo == (regoff_t)strlen(cmd)))) ^ OPT_INVERT ) { matched_pid = proc->pid; if (OPT_LAST) { diff --git a/procps/pidof.c b/procps/pidof.c index 46e646d..8ed5a21 100644 --- a/procps/pidof.c +++ b/procps/pidof.c @@ -59,7 +59,7 @@ int pidof_main(int argc ATTRIBUTE_UNUSED, char **argv) if (opt & OPT_OMIT) { llist_t *omits_p = omits; while (omits_p) { - if (xatoul(omits_p->data) == *pl) { + if (xatoul(omits_p->data) == (unsigned long)(*pl)) { goto omitting; } omits_p = omits_p->link; diff --git a/procps/ps.c b/procps/ps.c index aeb8cec..cf939bb 100644 --- a/procps/ps.c +++ b/procps/ps.c @@ -310,7 +310,7 @@ static ps_out_t* new_out_t(void) static const ps_out_t* find_out_spec(const char *name) { - int i; + unsigned i; for (i = 0; i < ARRAY_SIZE(out_spec); i++) { if (!strcmp(name, out_spec[i].name)) return &out_spec[i]; diff --git a/procps/top.c b/procps/top.c index 206f9e8..ca43376 100644 --- a/procps/top.c +++ b/procps/top.c @@ -53,7 +53,7 @@ typedef struct jiffy_counts_t { the next. Used for finding deltas. */ typedef struct save_hist { unsigned long ticks; - unsigned pid; + pid_t pid; } save_hist; typedef int (*cmp_funcp)(top_status_t *P, top_status_t *Q); @@ -317,7 +317,7 @@ static unsigned long display_header(int scr_width) fclose(fp); /* output memory info */ - if (scr_width > sizeof(scrbuf)) + if (scr_width > (int)sizeof(scrbuf)) scr_width = sizeof(scrbuf); snprintf(scrbuf, scr_width, "Mem: %luK used, %luK free, %luK shrd, %luK buff, %luK cached", @@ -481,7 +481,7 @@ static NOINLINE void display_process_list(int count, int scr_width) , SHOW_STAT(pcpu) #endif ); - if (col + 1 < scr_width) + if ((int)(col + 1) < scr_width) read_cmdline(line_buf + col, scr_width - col - 1, s->pid, s->comm); fputs(line_buf, stdout); /* printf(" %d/%d %lld/%lld", s->pcpu, total_pcpu, @@ -584,7 +584,7 @@ static char *grab_number(char *str, const char *match, unsigned sz) static void display_topmem_header(int scr_width) { char linebuf[128]; - int i; + unsigned i; FILE *fp; union { struct { @@ -703,7 +703,7 @@ static NOINLINE void display_topmem_process_list(int count, int scr_width) ulltoa6_and_space(s->dirty_sh, &line_buf[6*6]); ulltoa6_and_space(s->stack , &line_buf[7*6]); line_buf[8*6] = '\0'; - if (scr_width > MIN_WIDTH) { + if (scr_width > (int)MIN_WIDTH) { read_cmdline(&line_buf[8*6], scr_width - MIN_WIDTH, s->pid, s->comm); } printf("\n""%.*s", scr_width, line_buf); |