-extern int SIclose( struct ginfo_blk *gptr, int fd )
-{
-
- struct tp_blk *tpptr; // pointer into tp list
- int status = SI_ERROR; // status of processing
-
- gptr->sierr = SI_ERR_HANDLE;
- if( gptr->magicnum == MAGICNUM ) // good cookie at the gptr address?
- {
- gptr->sierr = SI_ERR_SESSID;
-
- if( fd >= 0 ) // if caller knew the fd number
- {
- for( tpptr = gptr->tplist; tpptr != NULL && tpptr->fd != fd;
- tpptr = tpptr->next ); // find the tppblock to close
- }
- else // user did not know the fd - find first Listener or UDP tp blk
- {
- if( fd == TCP_LISTEN_PORT ) // close first tcp listen port; else first udp
- for( tpptr = gptr->tplist; tpptr != NULL && !(tpptr->flags&& TPF_LISTENFD); tpptr = tpptr->next );
- else
- for( tpptr = gptr->tplist; tpptr != NULL && tpptr->type != SOCK_DGRAM; tpptr = tpptr->next );
- }
+extern int SIclose( struct ginfo_blk *gptr, int fd ) {
+ struct tp_blk *tpptr; // pointer into tp list
+ int status = SI_ERROR; // status of processing