version 1.1.2.2, 2013/03/13 14:25:32
|
version 1.1.2.3, 2013/03/13 14:31:52
|
Line 80 sess_initSession(int id, const char *csFName, ait_sess
|
Line 80 sess_initSession(int id, const char *csFName, ait_sess
|
memset(*Sess, 0, sizeof(ait_sess_t)); |
memset(*Sess, 0, sizeof(ait_sess_t)); |
strlcpy((*Sess)->name, csFName, sizeof (*Sess)->name); |
strlcpy((*Sess)->name, csFName, sizeof (*Sess)->name); |
|
|
h = open((*Sess)->name, O_WRONLY | O_CREAT | O_EXCL, MEM_MODE); | h = open((*Sess)->name, O_WRONLY | O_CREAT | O_EXCL, SESS_MEM_MODE); |
if (h == -1) { |
if (h == -1) { |
if (errno != EEXIST) { |
if (errno != EEXIST) { |
LOGERR; |
LOGERR; |
Line 243 map_createSession(int nSeed, long nSize, ait_sess_t *
|
Line 243 map_createSession(int nSeed, long nSize, ait_sess_t *
|
#endif |
#endif |
|
|
/* create semaphore & add 1 */ |
/* create semaphore & add 1 */ |
Sess->id.sid = sem_open(szSName[0], O_CREAT, MEM_MODE); | Sess->id.sid = sem_open(szSName[0], O_CREAT, SESS_MEM_MODE); |
if (Sess->id.sid == SEM_FAILED) { |
if (Sess->id.sid == SEM_FAILED) { |
LOGERR; |
LOGERR; |
map_destroySession(Sess); |
map_destroySession(Sess); |
Line 255 map_createSession(int nSeed, long nSize, ait_sess_t *
|
Line 255 map_createSession(int nSeed, long nSize, ait_sess_t *
|
|
|
/* create file for shared memory storage */ |
/* create file for shared memory storage */ |
#ifdef HAVE_SHM_OPEN |
#ifdef HAVE_SHM_OPEN |
Sess->mem.fd = shm_open(szSName[1], O_RDWR | O_CREAT, MEM_MODE); | Sess->mem.fd = shm_open(szSName[1], O_RDWR | O_CREAT, SESS_MEM_MODE); |
#else |
#else |
Sess->mem.fd = open(szSName[1], O_RDWR | O_CREAT, MEM_MODE); | Sess->mem.fd = open(szSName[1], O_RDWR | O_CREAT, SESS_MEM_MODE); |
#endif |
#endif |
if (Sess->mem.fd == -1) { |
if (Sess->mem.fd == -1) { |
LOGERR; |
LOGERR; |
Line 360 ipc_createSession(int nSeed, long nSize, ait_sess_t *
|
Line 360 ipc_createSession(int nSeed, long nSize, ait_sess_t *
|
} |
} |
|
|
/* create semaphore */ |
/* create semaphore */ |
Sess->id.semid = semget(Sess->key, 1, MEM_MODE | IPC_CREAT); | Sess->id.semid = semget(Sess->key, 1, SESS_MEM_MODE | IPC_CREAT); |
if (Sess->id.semid == -1) { |
if (Sess->id.semid == -1) { |
LOGERR; |
LOGERR; |
ipc_destroySession(Sess); |
ipc_destroySession(Sess); |
Line 377 ipc_createSession(int nSeed, long nSize, ait_sess_t *
|
Line 377 ipc_createSession(int nSeed, long nSize, ait_sess_t *
|
} |
} |
|
|
/* create shared memory object */ |
/* create shared memory object */ |
Sess->mem.shmid = shmget(Sess->key, nSize, MEM_MODE | IPC_CREAT); | Sess->mem.shmid = shmget(Sess->key, nSize, SESS_MEM_MODE | IPC_CREAT); |
if (Sess->mem.shmid == -1) { |
if (Sess->mem.shmid == -1) { |
LOGERR; |
LOGERR; |
ipc_destroySession(Sess); |
ipc_destroySession(Sess); |