diff options
-rw-r--r-- | include/bbs.h | 8 | ||||
-rw-r--r-- | 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 <stdio.h> @@ -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; i<STAT_NUM; i++) { - char *desc= i*sizeof(char*)<sizeof(stat_desc)?stat_desc[i]:"?"; + const char *desc= i*sizeof(char*)<sizeof(stat_desc)?stat_desc[i]:"?"; printf("%s:\t%d\n", desc, SHM->statistic[i]); } if(flag_clear) |