From 916266c02989e9f41dfa561ca39ec3be3f994fb1 Mon Sep 17 00:00:00 2001 From: in2 Date: Sat, 6 Apr 2002 01:39:04 +0000 Subject: shmctl shouldn't create shared memory itself git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@86 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/shmctl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/shmctl.c b/util/shmctl.c index 9c458e7d..6a0ea764 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "config.h" #include "pttstruct.h" #include "util.h" @@ -219,6 +220,12 @@ int main(int argc, char **argv) int i = 0; if( argc >= 2 ){ + /* shmctl shouldn't create shm itself */ + int shmid = shmget(UHASH_KEY, sizeof(*utmpshm), 0); + if( shmid < 0 ){ + perror("attach utmpshm"); + return 1; + } chdir(BBSHOME); resolve_utmp(); resolve_boards(); -- cgit v1.2.3