Bring in OpenBSD's mandoc(1) tool for formatting manual pages.
[dragonfly.git] / contrib / tcp_wrappers / clean_exit.c
blobcb9d4f5080d94ae73827aaf1af0a5824f27ed152
1 /*
2 * clean_exit() cleans up and terminates the program. It should be called
3 * instead of exit() when for some reason the real network daemon will not or
4 * cannot be run. Reason: in the case of a datagram-oriented service we must
5 * discard the not-yet received data from the client. Otherwise, inetd will
6 * see the same datagram again and again, and go into a loop.
7 *
8 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
9 */
11 #ifndef lint
12 static char sccsid[] = "@(#) clean_exit.c 1.4 94/12/28 17:42:19";
13 #endif
15 #include <stdio.h>
17 extern void exit();
19 #include "tcpd.h"
21 /* clean_exit - clean up and exit */
23 void clean_exit(request)
24 struct request_info *request;
28 * In case of unconnected protocols we must eat up the not-yet received
29 * data or inetd will loop.
32 if (request->sink)
33 request->sink(request->fd);
36 * Be kind to the inetd. We already reported the problem via the syslogd,
37 * and there is no need for additional garbage in the logfile.
40 sleep(5);
41 exit(0);