diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-06 09:39:04 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-06 09:39:04 +0800 |
commit | 916266c02989e9f41dfa561ca39ec3be3f994fb1 (patch) | |
tree | 1c654e19f6800b2dee1ef3c1aaf2cdbc94d790a1 /util/shmctl.c | |
parent | a735012a14f59f4d8f05814355731a74fd33869f (diff) | |
download | pttbbs-916266c02989e9f41dfa561ca39ec3be3f994fb1.tar pttbbs-916266c02989e9f41dfa561ca39ec3be3f994fb1.tar.gz pttbbs-916266c02989e9f41dfa561ca39ec3be3f994fb1.tar.bz2 pttbbs-916266c02989e9f41dfa561ca39ec3be3f994fb1.tar.lz pttbbs-916266c02989e9f41dfa561ca39ec3be3f994fb1.tar.xz pttbbs-916266c02989e9f41dfa561ca39ec3be3f994fb1.tar.zst pttbbs-916266c02989e9f41dfa561ca39ec3be3f994fb1.zip |
shmctl shouldn't create shared memory itself
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@86 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/shmctl.c')
-rw-r--r-- | util/shmctl.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 <signal.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/shm.h> #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(); |