misc: eliminate a couple of miscellaneous gcc warnings
This commit just address the two warnings shown below. Reference(s): pgrep.c: In function `select_procs': pgrep.c:535:12: warning: variable `now' set but not used [-Wunused-but-set-variable] 535 | time_t now; | ^~~ pidof.c: In function `select_procs': pidof.c:201:9: warning: `stat_cmd' may be used uninitialized in this function [-Wmaybe-uninitialized] 201 | !strcmp(program, stat_cmd) || | ^~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
97458da808
commit
c8864e8010
2
pgrep.c
2
pgrep.c
@ -529,12 +529,10 @@ static struct el * select_procs (int *num)
|
|||||||
char *cmdoutput = xmalloc(cmdlen);
|
char *cmdoutput = xmalloc(cmdlen);
|
||||||
char *task_cmdline;
|
char *task_cmdline;
|
||||||
enum pids_fetch_type which;
|
enum pids_fetch_type which;
|
||||||
time_t now;
|
|
||||||
double uptime_secs;
|
double uptime_secs;
|
||||||
|
|
||||||
preg = do_regcomp();
|
preg = do_regcomp();
|
||||||
|
|
||||||
now = time(NULL);
|
|
||||||
if (procps_uptime(&uptime_secs, NULL) < 0)
|
if (procps_uptime(&uptime_secs, NULL) < 0)
|
||||||
xerrx(EXIT_FAILURE, "uptime");
|
xerrx(EXIT_FAILURE, "uptime");
|
||||||
|
|
||||||
|
4
pidof.c
4
pidof.c
@ -145,7 +145,6 @@ static void select_procs (void)
|
|||||||
static int size = 0;
|
static int size = 0;
|
||||||
char *cmd_arg0, *cmd_arg0base;
|
char *cmd_arg0, *cmd_arg0base;
|
||||||
char *cmd_arg1, *cmd_arg1base;
|
char *cmd_arg1, *cmd_arg1base;
|
||||||
char *stat_cmd;
|
|
||||||
char *program_base;
|
char *program_base;
|
||||||
char *root_link;
|
char *root_link;
|
||||||
char *exe_link;
|
char *exe_link;
|
||||||
@ -196,9 +195,6 @@ static void select_procs (void)
|
|||||||
if (!strcmp(program, cmd_arg0base) ||
|
if (!strcmp(program, cmd_arg0base) ||
|
||||||
!strcmp(program_base, cmd_arg0) ||
|
!strcmp(program_base, cmd_arg0) ||
|
||||||
!strcmp(program, cmd_arg0) ||
|
!strcmp(program, cmd_arg0) ||
|
||||||
|
|
||||||
!strcmp(program, stat_cmd) ||
|
|
||||||
|
|
||||||
!strcmp(program, exe_link_base) ||
|
!strcmp(program, exe_link_base) ||
|
||||||
!strcmp(program, exe_link))
|
!strcmp(program, exe_link))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user