这样的
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;
void countidnumber(void)
{
int i;
idnumber = 0;
for (i=0;i<MAXUSERS;i++)
if (uidshm->passwd[i].userid[0]!='\0')
idnumber++;
}
int getidnumber(void)
{
return idnumber;
}
在load_ucache尾部
ucache_unlock(fd);
countidnumber();
return 0;
}
flush_ucache尾部
countidnumber();
return ret;
}
【 在 cometcaptor (参宿四[☆]一闪一闪亮晶晶) 的大作中提到: 】
: countidnumber放在load_ucache,flush_ucache的return前面
--
FROM 211.151.95.*