Diff for /libaitsess/src/aitsess.c between versions 1.5 and 1.6

version 1.5, 2012/02/28 13:00:24 version 1.6, 2012/07/22 22:13:48
Line 109  sess_initSession(int id, const char *csFName, ait_sess Line 109  sess_initSession(int id, const char *csFName, ait_sess
         }          }
   
         if (!*Sess) {          if (!*Sess) {
                *Sess = malloc(sizeof(ait_sess_t));                *Sess = io_malloc(sizeof(ait_sess_t));
                 if (!*Sess) {                  if (!*Sess) {
                         LOGERR;                          LOGERR;
                         return -1;                          return -1;
Line 122  sess_initSession(int id, const char *csFName, ait_sess Line 122  sess_initSession(int id, const char *csFName, ait_sess
         if (h == -1) {          if (h == -1) {
                 if (errno != EEXIST) {                  if (errno != EEXIST) {
                         LOGERR;                          LOGERR;
                        free(*Sess);                        io_free(*Sess);
                         return -1;                          return -1;
                 }                  }
                 /* If key file exist, session already connected */                  /* If key file exist, session already connected */
                 h = open((*Sess)->name, O_RDONLY);                  h = open((*Sess)->name, O_RDONLY);
                 if (h == -1) {                  if (h == -1) {
                         LOGERR;                          LOGERR;
                        free(*Sess);                        io_free(*Sess);
                         return -1;                          return -1;
                 }                  }
                 ret = read(h, szStr, sizeof szStr);                  ret = read(h, szStr, sizeof szStr);
                 if (ret == -1) {                  if (ret == -1) {
                         LOGERR;                          LOGERR;
                         close(h);                          close(h);
                        free(*Sess);                        io_free(*Sess);
                         return -1;                          return -1;
                 }                  }
                 if (!strncmp(szStr, "IPC@", 4) && id == SHARED_IPC) {                  if (!strncmp(szStr, "IPC@", 4) && id == SHARED_IPC) {
Line 165  sess_initSession(int id, const char *csFName, ait_sess Line 165  sess_initSession(int id, const char *csFName, ait_sess
                         sess_SetErr(EPROTONOSUPPORT,                           sess_SetErr(EPROTONOSUPPORT, 
                                         "Session type not supported or wrong session type");                                          "Session type not supported or wrong session type");
                         close(h);                          close(h);
                        free(*Sess);                        io_free(*Sess);
                         return -1;                          return -1;
                 }                  }
                 /* key found */                  /* key found */
Line 197  sess_initSession(int id, const char *csFName, ait_sess Line 197  sess_initSession(int id, const char *csFName, ait_sess
                         sess_SetErr(EINVAL, "Session type must be specified");                          sess_SetErr(EINVAL, "Session type must be specified");
                         close(h);                          close(h);
                         unlink(csFName);                          unlink(csFName);
                        free(*Sess);                        io_free(*Sess);
                         return -1;                          return -1;
                 }                  }
                 strlcat(szStr, "ELWIX_Session ("PACKAGE_STRING")\n", sizeof szStr);                  strlcat(szStr, "ELWIX_Session ("PACKAGE_STRING")\n", sizeof szStr);
Line 234  sess_freeSession(ait_sess_t ** __restrict Sess) Line 234  sess_freeSession(ait_sess_t ** __restrict Sess)
         (*Sess)->type = SHARED_UNKNOWN;          (*Sess)->type = SHARED_UNKNOWN;
         */          */
   
        free(*Sess);        io_free(*Sess);
         *Sess = NULL;          *Sess = NULL;
 }  }
   

Removed from v.1.5  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>