--- libaitsess/src/aitsess.c 2008/10/13 18:22:01 1.1.1.1.2.2 +++ libaitsess/src/aitsess.c 2010/08/26 00:06:38 1.1.1.1.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsess.c,v 1.1.1.1.2.2 2008/10/13 18:22:01 misho Exp $ +* $Id: aitsess.c,v 1.1.1.1.2.3 2010/08/26 00:06:38 misho Exp $ * *************************************************************************/ #include "global.h" @@ -71,7 +71,7 @@ inline int initSession(const int cnID, const char *csF if (!access(csFName, F_OK)) ret = 1; // Build new key & new session - h = open(csFName, O_WRONLY | O_CREAT, 0640); + h = open(csFName, O_WRONLY | O_CREAT, MEM_MODE); if (h == -1) { LOGERR; free(*Sess); @@ -160,7 +160,7 @@ int map_createSession(const char *csFName, const int c memset(mem, 0, cnSize); // create semaphore & add 1 - (*Sess)->id.sid = sem_open(szSName[0], O_CREAT, 0644); + (*Sess)->id.sid = sem_open(szSName[0], O_CREAT, MEM_MODE); if ((*Sess)->id.sid == SEM_FAILED) { LOGERR; map_destroySession(csFName, Sess); @@ -170,7 +170,7 @@ int map_createSession(const char *csFName, const int c sem_post((*Sess)->id.sid); // create file for shared memory storage - (*Sess)->mem.fd = open(szSName[1], O_RDWR | O_CREAT, 0644); + (*Sess)->mem.fd = open(szSName[1], O_RDWR | O_CREAT, MEM_MODE); if ((*Sess)->mem.fd == -1) { LOGERR; map_destroySession(csFName, Sess); @@ -260,7 +260,7 @@ int ipc_createSession(const char *csFName, const int c } // create semaphore - (*Sess)->id.semid = semget((*Sess)->key, 1, 0644 | IPC_CREAT); + (*Sess)->id.semid = semget((*Sess)->key, 1, MEM_MODE | IPC_CREAT); if ((*Sess)->id.semid == -1) { LOGERR; ipc_destroySession(csFName, Sess); @@ -277,7 +277,7 @@ int ipc_createSession(const char *csFName, const int c } // create shared memory object - (*Sess)->mem.shmid = shmget((*Sess)->key, cnSize, 0644 | IPC_CREAT); + (*Sess)->mem.shmid = shmget((*Sess)->key, cnSize, MEM_MODE | IPC_CREAT); if ((*Sess)->mem.shmid == -1) { LOGERR; ipc_destroySession(csFName, Sess);