pgrep,pkill: new applets by Loic Grenie <loic.grenie@gmail.com>

This commit is contained in:
Denis Vlasenko
2007-09-29 22:26:01 +00:00
parent 2450e4ba44
commit 72e1c89d97
9 changed files with 226 additions and 28 deletions

View File

@ -375,13 +375,22 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
}
}
#else
if (flags & PSSCAN_ARGV0) {
if (flags & *PSSCAN_ARGV0|PSSCAN_ARGVN)) {
free(sp->argv0);
sp->argv0 = NULL;
strcpy(filename_tail, "/cmdline");
n = read_to_buf(filename, buf);
if (n <= 0)
break;
#if ENABLE_PGREP || ENABLE_PKILL
if (flags & PSSCAN_ARGVN) {
do {
n--;
if (buf[n] == '\0')
buf[n] = ' ';
} while (n);
}
#endif
sp->argv0 = xstrdup(buf);
}
#endif