--- libaitsess/src/aitsess.c 2011/08/21 14:00:43 1.2.2.3 +++ libaitsess/src/aitsess.c 2011/11/03 23:23:18 1.3.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsess.c,v 1.2.2.3 2011/08/21 14:00:43 misho Exp $ +* $Id: aitsess.c,v 1.3.2.2 2011/11/03 23:23:18 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -105,8 +105,8 @@ initSession(int *pnID, const char *csFName, tagSess ** LOGERR; return -1; } - } else - memset(*Sess, 0, sizeof(tagSess)); + } + memset(*Sess, 0, sizeof(tagSess)); if (pnID && *pnID) id = *pnID; @@ -228,7 +228,8 @@ map_createSession(const char *csFName, const int cnSee LOGERR; map_destroySession(csFName, Sess); return -1; - } else + } + if (!ret) sem_post((*Sess)->id.sid); /* create file for shared memory storage */ @@ -386,7 +387,7 @@ map_attachSession(tagSess * __restrict s, void *procMe if (!s) return NULL; - // Learn size of shared memory block + /* Learn size of shared memory block */ sync(); if (fstat(s->mem.fd, &sb) == -1) { LOGERR; @@ -394,7 +395,7 @@ map_attachSession(tagSess * __restrict s, void *procMe } else s->eom = sb.st_size; - // attach to memory + /* attach to memory */ s->addr = mmap(procMem, s->eom, PROT_READ | PROT_WRITE, MAP_SHARED, s->mem.fd, 0); if (s->addr == MAP_FAILED) { LOGERR;