Tools/sysctl: some changes were omitted from the last commit.

This commit is contained in:
logwang 2017-05-27 03:44:01 +08:00
parent 2d99e60c29
commit 34a144bd04
1 changed files with 17 additions and 0 deletions

View File

@ -78,6 +78,8 @@ static const char rcsid[] =
#include <unistd.h> #include <unistd.h>
#ifdef FSTACK #ifdef FSTACK
#include <time.h>
#include "sysctl.h" #include "sysctl.h"
#include "ff_ipc.h" #include "ff_ipc.h"
@ -147,9 +149,15 @@ static void
usage(void) usage(void)
{ {
#ifndef FSTACK
(void)fprintf(stderr, "%s\n%s\n", (void)fprintf(stderr, "%s\n%s\n",
"usage: sysctl [-bdehiNnoqTtWx] [ -B <bufsize> ] [-f filename] name[=value] ...", "usage: sysctl [-bdehiNnoqTtWx] [ -B <bufsize> ] [-f filename] name[=value] ...",
" sysctl [-bdehNnoqTtWx] [ -B <bufsize> ] -a"); " sysctl [-bdehNnoqTtWx] [ -B <bufsize> ] -a");
#else
(void)fprintf(stderr, "%s\n%s\n",
"usage: sysctl -p <f-stack proc_id> [-bdehiNnoqTtWx] [ -B <bufsize> ] [-f filename] name[=value] ...",
" sysctl -p <f-stack proc_id> [-bdehNnoqTtWx] [ -B <bufsize> ] -a");
#endif
exit(1); exit(1);
} }
@ -163,7 +171,11 @@ main(int argc, char **argv)
setbuf(stdout,0); setbuf(stdout,0);
setbuf(stderr,0); setbuf(stderr,0);
#ifndef FSTACK
while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) { while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) {
#else
while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxXp:")) != -1) {
#endif
switch (ch) { switch (ch) {
case 'A': case 'A':
/* compatibility */ /* compatibility */
@ -225,6 +237,11 @@ main(int argc, char **argv)
case 'x': case 'x':
xflag = 1; xflag = 1;
break; break;
#ifdef FSTACK
case 'p':
proc_id = atoi(optarg);
break;
#endif
default: default:
usage(); usage();
} }