summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-05 21:38:01 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-05 21:38:01 +0800
commite4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f (patch)
tree8a4253895ab9784a03840d1e329458c635a84496
parent880a2e11a9af744c7bc9121c25f81550b5700fdd (diff)
downloadpttbbs-e4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f.tar
pttbbs-e4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f.tar.gz
pttbbs-e4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f.tar.bz2
pttbbs-e4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f.tar.lz
pttbbs-e4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f.tar.xz
pttbbs-e4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f.tar.zst
pttbbs-e4fea8d3d9a8697ecf4fcf6c929919a5aa4d558f.zip
add utmpnum for snmpd
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@80 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/shmctl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/util/shmctl.c b/util/shmctl.c
index b8f4c5a6..9c458e7d 100644
--- a/util/shmctl.c
+++ b/util/shmctl.c
@@ -196,6 +196,12 @@ int utmpwatch(int argc, char **argv)
return 0;
}
+int utmpnum(int argc, char **argv)
+{
+ printf("%d.0\n", utmpshm->number);
+ return 0;
+}
+
struct {
int (*func)(int, char **);
char *cmd, *descript;
@@ -205,6 +211,7 @@ struct {
{utmpreset, "utmpreset", "utmpshm->busystate=0"},
{utmpsort, "utmpsort", "sort ulist"},
{utmpwatch, "utmpwatch", "to see if busystate is always 1 then fix it"},
+ {utmpnum, "utmpnum", "print utmpshm->number for snmpd"},
{NULL, NULL, NULL} };
int main(int argc, char **argv)
@@ -219,8 +226,7 @@ int main(int argc, char **argv)
resolve_fcache();
for( i = 0 ; cmd[i].func != NULL ; ++i )
if( strcmp(cmd[i].cmd, argv[1]) == 0 ){
- cmd[i].func(argc - 2, &argv[2]);
- break;
+ return cmd[i].func(argc - 2, &argv[2]);
}
}
if( argc == 1 || cmd[i].func == NULL ){