好像还是有问题
struct UCACHE {
ucache_hashtable hashtable;
ucache_hashtable hashusage;
int hashhead[UCACHE_HASHSIZE + 1];
int next[MAXUSERS];
time_t uptime;
int number;
#ifdef HAVE_CUSTOM_USER_TITLE
char user_title[255][USER_TITLE_LEN]; //定义用户的称号字符串。
#endif
struct userec passwd[MAXUSERS];
int idnumber; //自己加的
};
然后
static void countidnumber(void)
{
int i,idnum=0;
for (i=0;i<MAXUSERS;i++)
if (uidshm->passwd[i].userid[0])
idnum++;
uidshm->idnumber = idnum;
}
int getidnumber(void)
{
int i,fd;
fd = ucache_lock();
i = uidshm->idnumber;
ucache_unlock(fd);
return i;
}
在flush_ucache的return前加上countidnumber();
在load_ucache的ucache_unlock(fd)前加上countidnumber();
然后BBS又上不了了。本地telnet 127.0.0.1显示
Trying 127.0.0.1...
Connected to localhost.flstu.
Escape character is '^]'.
Error! shmget error! key = x.
Connection closed by foreign host.
【 在 cometcaptor (参宿四[☆]一闪一闪亮晶晶) 的大作中提到: 】
: 原来如此,谢谢~
--
FROM 211.151.95.*