ps: fix "unused variable" warning; fix integer variable declared as char.
This commit is contained in:
parent
16b7cb455d
commit
dc7a5eae36
@ -340,8 +340,9 @@ int ps_main(int argc, char **argv);
|
|||||||
int ps_main(int argc, char **argv)
|
int ps_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
procps_status_t *p = NULL;
|
procps_status_t *p = NULL;
|
||||||
int i, len;
|
int len;
|
||||||
SKIP_SELINUX(const) int use_selinux = 0;
|
SKIP_SELINUX(const) int use_selinux = 0;
|
||||||
|
USE_SELINUX(int i;)
|
||||||
#if !ENABLE_FEATURE_PS_WIDE
|
#if !ENABLE_FEATURE_PS_WIDE
|
||||||
enum { terminal_width = 79 };
|
enum { terminal_width = 79 };
|
||||||
#else
|
#else
|
||||||
@ -367,7 +368,7 @@ int ps_main(int argc, char **argv)
|
|||||||
i = getopt32(argc, argv, "Z");
|
i = getopt32(argc, argv, "Z");
|
||||||
#endif
|
#endif
|
||||||
#if ENABLE_SELINUX
|
#if ENABLE_SELINUX
|
||||||
if ((i & 1) && is_selinux_enabled())
|
if (i && is_selinux_enabled())
|
||||||
use_selinux = PSSCAN_CONTEXT;
|
use_selinux = PSSCAN_CONTEXT;
|
||||||
#endif
|
#endif
|
||||||
#endif /* ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX */
|
#endif /* ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX */
|
||||||
@ -404,7 +405,7 @@ int ps_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
char sz = terminal_width - len;
|
int sz = terminal_width - len;
|
||||||
char buf[sz + 1];
|
char buf[sz + 1];
|
||||||
read_cmdline(buf, sz, p->pid, p->comm);
|
read_cmdline(buf, sz, p->pid, p->comm);
|
||||||
puts(buf);
|
puts(buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user