From 338166df574ef2dc744dffd79e77fbd0e12af1e8 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 19 Jul 2016 00:00:00 -0500 Subject: [PATCH] misc: just eliminate several 'unused' warning messages [ plus we also play catch up on some earlier changes ] [ that impacted skill.c, after using --enable-skill! ] Signed-off-by: Jim Warner --- free.c | 1 - proc/sysinfo.c | 2 -- ps/output.c | 2 ++ ps/sortformat.c | 2 +- ps/stacktrace.c | 2 +- skill.c | 8 ++++---- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/free.c b/free.c index 509fe54a..bd32a853 100644 --- a/free.c +++ b/free.c @@ -202,7 +202,6 @@ static void check_unit_set(int *unit_set) int main(int argc, char **argv) { int c, flags = 0, unit_set = 0; - char *endptr; struct commandline_arguments args; struct procps_meminfo *mem_info = NULL; diff --git a/proc/sysinfo.c b/proc/sysinfo.c index 2189433b..92de3ff0 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -188,8 +188,6 @@ PROCPS_EXPORT unsigned int procps_pid_length(void) { FILE *fp; char pidbuf[24]; - char *endp; - unsigned long int max_pid; static int pid_length=0; if (pid_length) diff --git a/ps/output.c b/ps/output.c index 7318462a..c3fdfa6a 100644 --- a/ps/output.c +++ b/ps/output.c @@ -1216,8 +1216,10 @@ setREL1(LXCNAME) static int pr_context(char *restrict const outbuf, const proc_t *restrict const pp){ static void (*ps_freecon)(char*) = 0; static int (*ps_getpidcon)(pid_t pid, char **context) = 0; +#if ENABLE_LIBSELINUX static int (*ps_is_selinux_enabled)(void) = 0; static int tried_load = 0; +#endif static int selinux_enabled = 0; size_t len; char *context; diff --git a/ps/sortformat.c b/ps/sortformat.c index 8235a197..106e66c1 100644 --- a/ps/sortformat.c +++ b/ps/sortformat.c @@ -236,7 +236,7 @@ static const char *format_parse(sf_node *sfn){ need_item=0; } } while (*++walk); -out: + if(!items){ free(buf); goto empty; diff --git a/ps/stacktrace.c b/ps/stacktrace.c index a0b4755c..06987524 100644 --- a/ps/stacktrace.c +++ b/ps/stacktrace.c @@ -172,6 +172,7 @@ void debug(int method, char *prog_name){ while(x); /* wait for debugger? */ } +#ifdef DEBUG /************/ static void stack_trace_sigsegv(int signum){ (void)signum; @@ -179,7 +180,6 @@ static void stack_trace_sigsegv(int signum){ } /************/ -#ifdef DEBUG void init_stack_trace(char *prog_name){ stored_prog_name = prog_name; signal(SIGSEGV, stack_trace_sigsegv); diff --git a/skill.c b/skill.c index 3d73d29b..7044cdc6 100644 --- a/skill.c +++ b/skill.c @@ -265,21 +265,21 @@ static void scan_procs(struct run_time_conf_t *run_time) #define PIDS_GETINT(e) PROCPS_PIDS_VAL(EU_ ## e, s_int, reap->stacks[i]) #define PIDS_GETSTR(e) PROCPS_PIDS_VAL(EU_ ## e, str, reap->stacks[i]) struct procps_pidsinfo *info=NULL; - struct pids_reap *reap; + struct pids_fetch *reap; int i, total_procs; - if (procps_pids_new(&info, 6, items) < 0) + if (procps_pids_new(&info, items, 6) < 0) xerrx(EXIT_FAILURE, _("Unable to create pid info structure")); if ((reap = procps_pids_reap(info, PROCPS_FETCH_TASKS_ONLY)) == NULL) xerrx(EXIT_FAILURE, _("Unable to load process information")); - total_procs = reap->counts.total; + total_procs = reap->counts->total; for (i=0; i < total_procs; i++) { if (PIDS_GETINT(PID) == my_pid || PIDS_GETINT(PID) == 0) continue; - if (uids && !match_intlist(PIDS_GETINT(EUID), uid_count, uids)) + if (uids && !match_intlist(PIDS_GETINT(EUID), uid_count, (int *)uids)) continue; if (ttys && !match_intlist(PIDS_GETINT(TTY), tty_count, ttys)) continue;