summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 09:52:18 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 09:52:18 +0800
commit435f181e8b560b2b987b163c3f776f21b74a3c7d (patch)
tree046b812c1e0e3fb5d96fea13e36d5506d7750954 /util
parent399258307ae2b0bc3676d1f64e01846cb85450fc (diff)
downloadpttbbs-435f181e8b560b2b987b163c3f776f21b74a3c7d.tar
pttbbs-435f181e8b560b2b987b163c3f776f21b74a3c7d.tar.gz
pttbbs-435f181e8b560b2b987b163c3f776f21b74a3c7d.tar.bz2
pttbbs-435f181e8b560b2b987b163c3f776f21b74a3c7d.tar.lz
pttbbs-435f181e8b560b2b987b163c3f776f21b74a3c7d.tar.xz
pttbbs-435f181e8b560b2b987b163c3f776f21b74a3c7d.tar.zst
pttbbs-435f181e8b560b2b987b163c3f776f21b74a3c7d.zip
bug fixed
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1647 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/uhash_loader.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/util/uhash_loader.c b/util/uhash_loader.c
index 1d755f7b..2ea80975 100644
--- a/util/uhash_loader.c
+++ b/util/uhash_loader.c
@@ -117,29 +117,11 @@ unsigned string_hash(unsigned char *s)
return (v * 2654435769UL) >> (32 - HASH_BITS);
}
-int loadmoney(userec_t *user)
-{
- int fd, money=0;
- char path[256];
-
- if(user->userid[0]==0) return 0;
- sprintf(path,BBSHOME "/home/%c/%s/.passwd", user->userid[0], user->userid);
-
- if((fd=open(path, O_RDONLY))<0)
- return user->money;
- if(lseek(fd, (off_t)((int)&(user->money) - (int)user), SEEK_SET) >= 0)
- read(fd, &money, sizeof(int));
- close(fd);
- return money;
-}
-
void add_to_uhash(int n, userec_t *user)
{
int *p, h = string_hash(user->userid);
strcpy(SHM->userid[n], user->userid);
- SHM->money[n] = loadmoney(user);
- //SHM->money[n] = user->money;
- // Ptt: money is not accurate must load from user home
+ SHM->money[n] = user->money;
p = &(SHM->hash_head[h]);