summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 09:44:57 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 09:44:57 +0800
commit399258307ae2b0bc3676d1f64e01846cb85450fc (patch)
treea0bda167b9c7245da8513820ca218f38c9bae4da
parentb12f10b3f034ab09558c7040b7c5ed254e76d680 (diff)
downloadpttbbs-399258307ae2b0bc3676d1f64e01846cb85450fc.tar
pttbbs-399258307ae2b0bc3676d1f64e01846cb85450fc.tar.gz
pttbbs-399258307ae2b0bc3676d1f64e01846cb85450fc.tar.bz2
pttbbs-399258307ae2b0bc3676d1f64e01846cb85450fc.tar.lz
pttbbs-399258307ae2b0bc3676d1f64e01846cb85450fc.tar.xz
pttbbs-399258307ae2b0bc3676d1f64e01846cb85450fc.tar.zst
pttbbs-399258307ae2b0bc3676d1f64e01846cb85450fc.zip
uhashloader debug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1646 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/uhash_loader.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/uhash_loader.c b/util/uhash_loader.c
index a23ecf47..1d755f7b 100644
--- a/util/uhash_loader.c
+++ b/util/uhash_loader.c
@@ -74,13 +74,13 @@ void fill_uhash(void)
for (fd = 0; fd < (1 << HASH_BITS); fd++)
SHM->hash_head[fd] = -1;
- if ((fd = open(FN_PASSWD, O_RDONLY)) > 0)
+ if ((fd = open(FN_PASSWD, O_RDWR)) > 0)
{
struct stat stbuf;
caddr_t fimage, mimage;
fstat(fd, &stbuf);
- fimage = mmap(NULL, stbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+ fimage = mmap(NULL, stbuf.st_size, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0);
if (fimage == (char *) -1)
{
perror("mmap");
@@ -130,7 +130,6 @@ int loadmoney(userec_t *user)
if(lseek(fd, (off_t)((int)&(user->money) - (int)user), SEEK_SET) >= 0)
read(fd, &money, sizeof(int));
close(fd);
- user->money=money;
return money;
}