From 479f91025c124cbaeca6c196367d6406c8d4af9e Mon Sep 17 00:00:00 2001 From: ptt Date: Mon, 5 Apr 2004 23:18:32 +0000 Subject: debug of money git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1703 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/cache.c | 1 + mbbsd/passwd.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'mbbsd') diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 5112efe0..261cfa5f 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -203,6 +203,7 @@ getuser(char *userid) if ((uid = searchuser(userid))) passwd_query(uid, &xuser); + xuser.money = moneyof(uid); return uid; } diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c index ce6cd233..d33433b5 100644 --- a/mbbsd/passwd.c +++ b/mbbsd/passwd.c @@ -95,12 +95,19 @@ passwd_query_money(int num) if ((pwdfd = open(path, O_WRONLY)) < 0) { if(passwd_index_query(num, &user)<0) // tempory code, will be removed - return -1; + return 0; return user.money; } if(lseek(pwdfd, (off_t)((int)&user.money - (int)&user), SEEK_SET) >= 0) read(pwdfd, &money, sizeof(int)); close(pwdfd); + if(money<0) + { + if(passwd_index_query(num, &user)<0) // tempory code, will be removed + return 0; + return user.money; + } + return money; } -- cgit v1.2.3