From 0efa8ac69be55f6533b48504ac1eb4f66ffd1dec Mon Sep 17 00:00:00 2001 From: in2 Date: Sat, 27 Mar 2004 12:34:28 +0000 Subject: leave board if brc_buf is not loaded git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1614 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 4 ++++ mbbsd/board.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 0c0a5220..ac8993b8 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2621,6 +2621,10 @@ Read() #ifdef LOG_BOARD time_t usetime = now; #endif + extern char *brc_buf; + + if( !brc_buf ) + return 0; setutmpmode(READING); set_board(); diff --git a/mbbsd/board.c b/mbbsd/board.c index 68c5603b..c02ca00d 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -55,7 +55,7 @@ brc_putrecord(char *ptr, const char *name, int num, const int *list) static int brc_changed = 0; /* The below two will be filled by read_brc_buf() and brc_update() */ -static char *brc_buf = NULL; +char *brc_buf = NULL; static int brc_size; static char * const fn_boardrc = ".boardrc"; @@ -150,7 +150,8 @@ brc_finalize(){ int fd; brc_update(); setuserfile(brcfile, fn_boardrc); - if ((fd = open(brcfile, O_WRONLY | O_CREAT | O_TRUNC, 0644)) != -1) { + if (brc_buf != NULL && + (fd = open(brcfile, O_WRONLY | O_CREAT | O_TRUNC, 0644)) != -1) { write(fd, brc_buf, brc_size); close(fd); } -- cgit v1.2.3