diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-08-06 16:58:25 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-08-06 16:58:25 +0800 |
commit | a2ab3f51c0451a715fc57be7379a87ce547869ff (patch) | |
tree | a09bb1bb0d7741ae7359e0e8173b46da6e2c05c8 /mbbsd/board.c | |
parent | 1f2d1734d6fd8c4d1306b5f7eed66b1f88be3d21 (diff) | |
download | pttbbs-a2ab3f51c0451a715fc57be7379a87ce547869ff.tar pttbbs-a2ab3f51c0451a715fc57be7379a87ce547869ff.tar.gz pttbbs-a2ab3f51c0451a715fc57be7379a87ce547869ff.tar.bz2 pttbbs-a2ab3f51c0451a715fc57be7379a87ce547869ff.tar.lz pttbbs-a2ab3f51c0451a715fc57be7379a87ce547869ff.tar.xz pttbbs-a2ab3f51c0451a715fc57be7379a87ce547869ff.tar.zst pttbbs-a2ab3f51c0451a715fc57be7379a87ce547869ff.zip |
general outta_swap
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@455 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r-- | mbbsd/board.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index d665360f..9f20b645 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1,4 +1,4 @@ -/* $Id: board.c,v 1.46 2002/08/06 08:43:06 in2 Exp $ */ +/* $Id: board.c,v 1.47 2002/08/06 08:58:25 in2 Exp $ */ #include "bbs.h" #define BRC_STRLEN 15 /* Length of board name */ #define BRC_MAXSIZE 24576 @@ -1018,26 +1018,12 @@ choose_board(int newflag) if (!(ptr->myattr & BRD_ZAP)) zapbuf[ptr->bid - 1] = now; #ifdef OUTTA_CACHE - { - int fd; - char fn[64]; - sprintf(fn, "cache/" MYHOSTNAME ".b%d", currpid); - if( (fd = open(fn, O_WRONLY | O_CREAT, 0600)) < 0 ) - abort_bbs(0); - write(fd, nbrd, nbrdlength); - close(fd); - free(nbrd); + outta_swapout(&nbrd, nbrdlength, 'b'); #endif - Read(); + Read(); #ifdef OUTTA_CACHE - if( (fd = open(fn, O_RDONLY)) < 0 ) - abort_bbs(0); - nbrd = (boardstat_t *) malloc(nbrdlength); - read(fd, nbrd, nbrdlength); - close(fd); - unlink(fn); - ptr = &nbrd[num]; - } + outta_swapin(&nbrd, nbrdlength, 'b'); + ptr = &nbrd[num]; #endif check_newpost(ptr); head = -1; |