⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clean_exit.c

📁 基于TCP-WRAP原理的系统监控的c语言实现代码
💻 C
字号:
 /*  * clean_exit() cleans up and terminates the program. It should be called  * instead of exit() when for some reason the real network daemon will not or  * cannot be run. Reason: in the case of a datagram-oriented service we must  * discard the not-yet received data from the client. Otherwise, inetd will  * see the same datagram again and again, and go into a loop.  *   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.  */#ifndef lintstatic char sccsid[] = "@(#) clean_exit.c 1.4 94/12/28 17:42:19";#endif#include <stdio.h>extern void exit();#include "tcpd.h"/* clean_exit - clean up and exit */void    clean_exit(request)struct request_info *request;{    /*     * In case of unconnected protocols we must eat up the not-yet received     * data or inetd will loop.     */    if (request->sink)	request->sink(request->fd);    /*     * Be kind to the inetd. We already reported the problem via the syslogd,     * and there is no need for additional garbage in the logfile.     */    sleep(5);    exit(0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -