Check which getprotobynumber_r() variant to use
[socat.git] / xioexit.c
blob05b1e345dbf50cdbaabf59d63beedbbb3c82cafe
1 /* source: xioexit.c */
2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 /* this file contains the source for the extended exit function */
7 #include "xiosysincludes.h"
8 #include "compat.h"
9 #include "xio.h"
10 #include "error.h"
13 /* this function closes all open xio sockets on exit, if they are still open.
14 It must be registered with atexit(). */
15 void xioexit(void) {
16 int i;
18 diag_in_handler = 0;
19 Debug("starting xioexit()");
20 for (i = 0; i < XIO_MAXSOCK; ++i) {
21 if (sock[i] != NULL && sock[i]->tag != XIO_TAG_INVALID) {
22 xioclose(sock[i]);
25 Debug("finished xioexit()");