File: xioexit.c

package info (click to toggle)
socat 1.4.2.0-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,144 kB
  • ctags: 3,624
  • sloc: ansic: 18,730; sh: 3,319; makefile: 153
file content (21 lines) | stat: -rw-r--r-- 587 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* $Id: xioexit.c,v 1.10 2005/03/13 12:19:11 gerhard Exp $ */
/* Copyright Gerhard Rieger 2001-2005 */
/* Published under the GNU General Public License V.2, see file COPYING */

/* this file contains the source for the extended exit function */

#include "xiosysincludes.h"
#include "xio.h"


/* this function closes all open xio sockets on exit, if they are still open.
   It must be registered with atexit(). */ 
void xioexit(void) {
   int i;

   for (i = 0; i < XIO_MAXSOCK; ++i) {
      if (sock[i] != NULL && sock[i]->tag != XIO_TAG_INVALID) {
	 xioclose(sock[i]);
      }
   }
}