From 47d33e7ed4e4d4f8a6910f796b776f9617a2e93a Mon Sep 17 00:00:00 2001 From: albert <> Date: Sat, 24 Jun 2006 20:12:29 +0000 Subject: [PATCH] g is criteria --- NEWS | 1 + pgrep.c | 11 ++++++----- proc/slab.c | 2 +- proc/sysinfo.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 67650a67..665e277c 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ pwdx: buffer overflow fixed -- thanks Ulf Harnhammar procps.spec needed a slash -- thanks Jesse Brandeburg w: stale utmp entries snuck in via uninitialized var -- thanks Robert A Basch pgrep/pkill: fix some realloc-related crashes #353894 +pgrep/pkill: g is criteria (secret PLD Linux patch) procps-3.2.5 --> procps-3.2.6 diff --git a/pgrep.c b/pgrep.c index 31e59548..e4fda6e8 100644 --- a/pgrep.c +++ b/pgrep.c @@ -55,7 +55,7 @@ static int opt_newest = 0; static int opt_negate = 0; static int opt_exact = 0; static int opt_signal = SIGTERM; -static int opt_flock = 0; +static int opt_lock = 0; static int opt_case = 0; static const char *opt_delim = "\n"; @@ -199,7 +199,7 @@ static union el *read_pidfile(void) if(fstat(fd,&sbuf) || !S_ISREG(sbuf.st_mode) || sbuf.st_size<1) goto out; // type of lock, if any, is not standardized on Linux - if(opt_flock && !has_flock(fd) && !has_fcntl(fd)) + if(opt_lock && !has_flock(fd) && !has_fcntl(fd)) goto out; memset(buf,'\0',sizeof buf); buf[read(fd,buf+1,sizeof buf-2)] = '\0'; @@ -581,8 +581,8 @@ static void parse_opts (int argc, char **argv) // break; // case 'J': // Solaris: match by project ID (name or number) // break; - case 'L': // FreeBSD: fail if pidfile (see -F) not locked with flock() - opt_flock++; + case 'L': // FreeBSD: fail if pidfile (see -F) not locked + opt_lock++; break; // case 'M': // FreeBSD: specify core (OS crash dump) file // break; @@ -619,6 +619,7 @@ static void parse_opts (int argc, char **argv) opt_pgrp = split_list (optarg, conv_pgrp); if (opt_pgrp == NULL) usage (opt); + ++criteria_count; break; // case 'i': // FreeBSD: ignore case. OpenBSD: withdrawn. See -I. This sucks. // if (opt_case) @@ -677,7 +678,7 @@ static void parse_opts (int argc, char **argv) } } - if(opt_flock && !opt_pidfile){ + if(opt_lock && !opt_pidfile){ fprintf(stderr, "%s: -L without -F makes no sense\n",progname); usage(0); } diff --git a/proc/slab.c b/proc/slab.c index 6736f0c8..60c56960 100644 --- a/proc/slab.c +++ b/proc/slab.c @@ -306,7 +306,7 @@ int get_slabinfo(struct slab_info **list, struct slab_stat *stats) slabfile = fopen(SLABINFO_FILE, "r"); if (!slabfile) { - perror("fopen"); + perror("fopen " SLABINFO_FILE); return 1; } diff --git a/proc/sysinfo.c b/proc/sysinfo.c index dcec24c3..095bb68e 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -30,7 +30,7 @@ long smp_num_cpus; /* number of CPUs */ "Error: /proc must be mounted\n" \ " To mount /proc at boot you need an /etc/fstab line like:\n" \ " /proc /proc proc defaults\n" \ -" In the meantime, mount /proc /proc -t proc\n" +" In the meantime, run \"mount /proc /proc -t proc\"\n" #define STAT_FILE "/proc/stat" static int stat_fd = -1;