From 3d8e3bc3cebd807bd32d8e9e11b0555aa24eb980 Mon Sep 17 00:00:00 2001 From: kcwu Date: Fri, 21 Sep 2007 00:17:59 +0000 Subject: * fix compile git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3566 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/bbs.h | 8 ++++++++ util/shmctl.c | 34 +++++++++++++++++----------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/include/bbs.h b/include/bbs.h index 43352242..4c03621b 100644 --- a/include/bbs.h +++ b/include/bbs.h @@ -3,6 +3,10 @@ #ifndef INCLUDE_BBS_H #define INCLUDE_BBS_H +#ifdef __cplusplus +extern "C" { +#endif + #include "osdep.h" #include @@ -71,4 +75,8 @@ typedef time_t time4_t; #include "var.h" #endif +#ifdef __cplusplus +} +#endif + #endif /* INCLUDE_BBS_H */ diff --git a/util/shmctl.c b/util/shmctl.c index 939fab39..42ba9415 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -980,24 +980,24 @@ int torb(int argc, char **argv) return 0; } -int fixbcache(int argc, char **argv) +void lockbcache(void) { - void lockbcache(void) - { - int i; - for( i = 0 ; i < 10 && SHM->Bbusystate ; ++i ){ - printf("SHM->Bbusystate is currently locked (value: %d). " - "please wait... ", SHM->Bbusystate); - sleep(1); - } - if( i == 10 ) - puts("steal bcache lock\n"); - SHM->Bbusystate = 1; - } - void unlockbcache(void) - { - SHM->Bbusystate = 0; + int i; + for( i = 0 ; i < 10 && SHM->Bbusystate ; ++i ){ + printf("SHM->Bbusystate is currently locked (value: %d). " + "please wait... ", SHM->Bbusystate); + sleep(1); } + if( i == 10 ) + puts("steal bcache lock\n"); + SHM->Bbusystate = 1; +} +void unlockbcache(void) +{ + SHM->Bbusystate = 0; +} +int fixbcache(int argc, char **argv) +{ int n, fd, bid, changed = 0; boardheader_t bh; @@ -1132,7 +1132,7 @@ int showstat(int argc, char *argv[]) if(argv[1] && strcmp(argv[1],"-c")==0) flag_clear=1; for(i=0; istatistic[i]); } if(flag_clear) -- cgit v1.2.3