2008-01-28 16:37:16 -05:00
|
|
|
/* source: xioexit.c */
|
2015-01-24 12:40:03 -05:00
|
|
|
/* Copyright Gerhard Rieger */
|
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"
|
2011-12-30 07:08:54 -05:00
|
|
|
#include "compat.h"
|
2008-01-27 07:00:08 -05:00
|
|
|
#include "xio.h"
|
2015-01-12 15:46:16 -05:00
|
|
|
#include "error.h"
|
2008-01-27 07:00:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
2015-01-12 15:46:16 -05:00
|
|
|
diag_in_handler = 0;
|
|
|
|
Debug("starting xioexit()");
|
2008-01-27 07:00:08 -05:00
|
|
|
for (i = 0; i < XIO_MAXSOCK; ++i) {
|
|
|
|
if (sock[i] != NULL && sock[i]->tag != XIO_TAG_INVALID) {
|
|
|
|
xioclose(sock[i]);
|
|
|
|
}
|
|
|
|
}
|
2015-01-12 15:46:16 -05:00
|
|
|
Debug("finished xioexit()");
|
2008-01-27 07:00:08 -05:00
|
|
|
}
|