From 6e73dec7f6f649a84e41c4a35c6655c9adef6acc Mon Sep 17 00:00:00 2001 From: ptt Date: Tue, 30 Mar 2004 17:16:30 +0000 Subject: debug of mmap git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1641 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/passwd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c index 95a3b39b..1a980e35 100644 --- a/mbbsd/passwd.c +++ b/mbbsd/passwd.c @@ -132,15 +132,15 @@ int initcuser(char *userid) if(!(usernum = searchuser(userid)) || usernum > MAX_USERS) return -1; sethomefile(path, userid, ".passwd"); - if((pwdfd = open(path, O_RDONLY)) < 0) + if((pwdfd = open(path, O_RDWR)) < 0) { if(passwd_index_query(usernum, &buf)<0) exit(1); passwd_update(usernum, &buf); - if((pwdfd = open(path, O_RDONLY)) < 0) exit(1); + if((pwdfd = open(path, O_RDWR)) < 0) exit(1); } - cuser = (userec_t *) mmap(NULL, sizeof(userec_t), PROT_READ, MAP_SHARED, - pwdfd, 0); + cuser = (userec_t *) mmap(NULL, sizeof(userec_t), PROT_WRITE|PROT_READ, + MAP_NOSYNC | MAP_SHARED, pwdfd, 0); if(cuser == (userec_t *) -1) exit(1); close(pwdfd); -- cgit v1.2.3