diff options
Diffstat (limited to 'util/uhash_loader.c')
-rw-r--r-- | util/uhash_loader.c | 20 |
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]); |