X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fsi%2Fsrc%2Fsi95%2Fsipoll.c;h=6c8915a87a0aedfb0efac6de6d6e3b0713f1693a;hb=05850e0815095c029ecff43ac8e0983f2fba4fb6;hp=d736d145b92d5c9555ab4918b8e6b120932aa6fd;hpb=fcea3951d44de0cc55d33c5e114487abe79d3406;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/src/si95/sipoll.c b/src/rmr/si/src/si95/sipoll.c index d736d14..6c8915a 100644 --- a/src/rmr/si/src/si95/sipoll.c +++ b/src/rmr/si/src/si95/sipoll.c @@ -42,9 +42,6 @@ extern int SIpoll( struct ginfo_blk *gptr, int msdelay ) { - //extern int deaths; // number of children that died and are zombies - //extern int sigflags; // flags set by the signal handler routine - int fd; // file descriptor for use in this routine int ((*cbptr)()); // pointer to callback routine to call int status = SI_OK; // return status @@ -77,7 +74,7 @@ extern int SIpoll( struct ginfo_blk *gptr, int msdelay ) pstat = select( gptr->fdcount, &gptr->readfds, &gptr->writefds, &gptr->execpfds, &delay ); - if( (pstat < 0 && errno != EINTR) ) + if( pstat < 0 && errno != EINTR ) { // poll fail or termination signal rcvd gptr->fdcount = 0; // prevent trying to look at a session gptr->flags |= GIF_SHUTDOWN; // cause cleanup and exit at end @@ -113,7 +110,7 @@ extern int SIpoll( struct ginfo_blk *gptr, int msdelay ) if( tpptr->flags & TPF_LISTENFD ) // listen port setup by init? { // yes-assume new session req - status = SInewsession( gptr, tpptr ); // make new session + SInewsession( gptr, tpptr ); // cannot do anything about failure, so ignore status } else // data received on a regular port if( tpptr->type == SOCK_DGRAM ) // udp socket? @@ -128,6 +125,7 @@ extern int SIpoll( struct ginfo_blk *gptr, int msdelay ) status = (*cbptr)( gptr->cbtab[SI_CB_RDATA].cbdata, gptr->rbuf, status, buf ); SIcbstat( gptr, status, SI_CB_RDATA ); // handle status free( buf ); + buf = NULL; // just to be safe } // end if call back was defined } // end if status was ok free( uaddr );