1 /* $NetBSD: clean_exit.c,v 1.2 1997/10/09 21:20:19 christos Exp $ */
4 * clean_exit() cleans up and terminates the program. It should be called
5 * instead of exit() when for some reason the real network daemon will not or
6 * cannot be run. Reason: in the case of a datagram-oriented service we must
7 * discard the not-yet received data from the client. Otherwise, inetd will
8 * see the same datagram again and again, and go into a loop.
10 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
13 #include <sys/cdefs.h>
16 static char sccsid
[] = "@(#) clean_exit.c 1.4 94/12/28 17:42:19";
18 __RCSID("$NetBSD: clean_exit.c,v 1.2 1997/10/09 21:20:19 christos Exp $");
28 /* clean_exit - clean up and exit */
30 void clean_exit(request
)
31 struct request_info
*request
;
35 * In case of unconnected protocols we must eat up the not-yet received
36 * data or inetd will loop.
40 request
->sink(request
->fd
);
43 * Be kind to the inetd. We already reported the problem via the syslogd,
44 * and there is no need for additional garbage in the logfile.