From 34a144bd0461401fd2fb748a73f12cdf48f02bc8 Mon Sep 17 00:00:00 2001 From: logwang Date: Sat, 27 May 2017 03:44:01 +0800 Subject: [PATCH] Tools/sysctl: some changes were omitted from the last commit. --- tools/sysctl/sysctl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/sysctl/sysctl.c b/tools/sysctl/sysctl.c index c1854e437..67c378186 100644 --- a/tools/sysctl/sysctl.c +++ b/tools/sysctl/sysctl.c @@ -78,6 +78,8 @@ static const char rcsid[] = #include #ifdef FSTACK +#include + #include "sysctl.h" #include "ff_ipc.h" @@ -147,9 +149,15 @@ static void usage(void) { +#ifndef FSTACK (void)fprintf(stderr, "%s\n%s\n", "usage: sysctl [-bdehiNnoqTtWx] [ -B ] [-f filename] name[=value] ...", " sysctl [-bdehNnoqTtWx] [ -B ] -a"); +#else + (void)fprintf(stderr, "%s\n%s\n", + "usage: sysctl -p [-bdehiNnoqTtWx] [ -B ] [-f filename] name[=value] ...", + " sysctl -p [-bdehNnoqTtWx] [ -B ] -a"); +#endif exit(1); } @@ -163,7 +171,11 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); +#ifndef FSTACK while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) { +#else + while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxXp:")) != -1) { +#endif switch (ch) { case 'A': /* compatibility */ @@ -225,6 +237,11 @@ main(int argc, char **argv) case 'x': xflag = 1; break; +#ifdef FSTACK + case 'p': + proc_id = atoi(optarg); + break; +#endif default: usage(); }