From 0e5c4373f46976bf312794cbf4d37bd70ee1b762 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 11 Apr 2018 00:00:00 -0500 Subject: [PATCH] Revert Support running with child namespace (catch up) --------------- Original Master Branch Commit Message: This reverts commit dcb6914f11406a13972636b08b7e26fdafe9efc9. This commit broke a lot of scripts that were expecting to see all programs. See #91 Signed-off-by: Jim Warner --- pgrep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pgrep.c b/pgrep.c index 004b6243..b8084525 100644 --- a/pgrep.c +++ b/pgrep.c @@ -144,7 +144,7 @@ static int __attribute__ ((__noreturn__)) usage(int opt) fputs(_(" -F, --pidfile read PIDs from file\n"), fp); fputs(_(" -L, --logpidfile fail if PID file is not locked\n"), fp); fputs(_(" --ns match the processes that belong to the same\n" - " namespace as or 0 for all namespaces\n"), fp); + " namespace as \n"), fp); fputs(_(" --nslist list which namespaces will be considered for\n" " the --ns option.\n" " Available namespaces: ipc, mnt, net, pid, user, uts\n"), fp); @@ -805,6 +805,8 @@ static void parse_opts (int argc, char **argv) * break; */ case NS_OPTION: opt_ns_pid = atoi(optarg); + if (opt_ns_pid == 0) + usage ('?'); ++criteria_count; break; case NSLIST_OPTION: @@ -859,7 +861,6 @@ int main (int argc, char **argv) textdomain(PACKAGE); atexit(close_stdout); - opt_ns_pid = getpid(); parse_opts (argc, argv); procs = select_procs (&num);