1
0
mirror of https://github.com/moparisthebest/socat synced 2024-11-04 08:15:04 -05:00
socat/xioexit.c

23 lines
569 B
C
Raw Normal View History

2008-01-28 16:37:16 -05:00
/* source: xioexit.c */
/* Copyright Gerhard Rieger 2001-2012 */
2008-01-27 07:00:08 -05:00
/* 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 "compat.h"
2008-01-27 07:00:08 -05:00
#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]);
}
}
}