summaryrefslogtreecommitdiffstats
path: root/mbbsd/stuff.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-16 11:18:25 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-16 11:18:25 +0800
commit99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf (patch)
tree7c428a12d3dd1621635ceaf115027fe50e2f35f2 /mbbsd/stuff.c
parent50374a66e62e9b9471928726536efb86e316eb1d (diff)
downloadpttbbs-99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf.tar
pttbbs-99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf.tar.gz
pttbbs-99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf.tar.bz2
pttbbs-99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf.tar.lz
pttbbs-99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf.tar.xz
pttbbs-99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf.tar.zst
pttbbs-99b0a1a8c53a7eef4347c7d9be8c425abaa4efbf.zip
Check angel permission before starting conversation.
Adding MAP_PRIVATE flag when getting MAP_ANON from mmap(). (on Linux, without this flag causes EINVAL) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2197 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r--mbbsd/stuff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index d35be51b..2f41f536 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -719,7 +719,8 @@ show_help(char * const helptext[])
void *MALLOC(int size)
{
int *p;
- p = (int *)mmap(NULL, (size + 4), PROT_READ | PROT_WRITE, MAP_ANON, -1, 0);
+ p = (int *)mmap(NULL, (size + 4), PROT_READ | PROT_WRITE,
+ MAP_ANON | MAP_PRIVATE, -1, 0);
p[0] = size;
#if defined(DEBUG) && !defined(_BBS_UTIL_C_)
vmsg("critical malloc %d bytes", size);