diff -ur apinger-0.6.1.orig//config.h.in apinger-0.6.1/config.h.in --- apinger-0.6.1.orig//config.h.in 2003-03-26 11:37:48.000000000 +0000 +++ apinger-0.6.1/config.h.in 2012-07-25 17:40:42.232252511 +0000 @@ -1,8 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to enable receiver subprocess */ -#undef FORKED_RECEIVER - /* Define to 1 if you have the `access' function. */ #undef HAVE_ACCESS diff -ur apinger-0.6.1.orig//configure apinger-0.6.1/configure --- apinger-0.6.1.orig//configure 2003-03-26 11:37:37.000000000 +0000 +++ apinger-0.6.1/configure 2012-07-25 17:40:42.235252628 +0000 @@ -851,8 +851,6 @@ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --disable-ipv6 Disable IPv6 support. - --enable-forked-receiver - Create subprocess for receiving pings. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -7132,23 +7130,6 @@ done -# Check whether --enable-forked-receiver or --disable-forked-receiver was given. -if test "${enable_forked_receiver+set}" = set; then - enableval="$enable_forked_receiver" - -else - enable_forked_receiver=no -fi; - -if test "x$enable_forked_receiver" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define FORKED_RECEIVER -_ACEOF - -fi - - # Check whether --with-rrdtool or --without-rrdtool was given. if test "${with_rrdtool+set}" = set; then withval="$with_rrdtool" diff -ur apinger-0.6.1.orig//configure.ac apinger-0.6.1/configure.ac --- apinger-0.6.1.orig//configure.ac 2003-03-26 11:37:16.000000000 +0000 +++ apinger-0.6.1/configure.ac 2012-07-25 17:40:42.235252628 +0000 @@ -56,34 +56,6 @@ AC_CHECK_FUNCS([sched_yield recvmsg]) -AC_ARG_ENABLE(forked-receiver,[AC_HELP_STRING([--enable-forked-receiver], - [Create subprocess for receiving pings.])], - [],[enable_forked_receiver=no]) - -if test "x$enable_forked_receiver" = "xyes" ; then - AC_DEFINE(FORKED_RECEIVER,[],[Define to enable receiver subprocess]) -dnl else -dnl AC_MSG_CHECKING([if PIPE_BUF is big enough]) -dnl if test "x$enable_forked_receiver" != "xno" ; then -dnl AC_TRY_RUN([ -dnl #ifdef HAVE_SYS_TYPES_H -dnl # include -dnl #endif -dnl #ifdef HAVE_LIMITS_H -dnl # include -dnl #endif -dnl -dnl int main(int argc,char **argv){ -dnl -dnl if (PIPE_BUF<1024) return 1; -dnl return 0; -dnl }], -dnl [AC_DEFINE(FORKED_RECEIVER,[1],[Define to enable receiver subprocess]) -dnl AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no]) -dnl AC_MSG_WARN([Receiver subprocess will not be used.])]) -dnl fi -fi - AC_ARG_WITH(rrdtool,[AC_HELP_STRING([--with-rrdtool=path],[Location of rrdtool program])], [ RRDTOOL="$withval" ],[ AC_PATH_PROG([RRDTOOL],[rrdtool],[rrdtool]) ]) AC_ARG_WITH(rrdcgi,[AC_HELP_STRING([--with-rrdcgi=path],[Location of rrdcgi program])], diff -ur apinger-0.6.1.orig//src/apinger.c apinger-0.6.1/src/apinger.c --- apinger-0.6.1.orig//src/apinger.c 2012-07-25 17:39:57.000000000 +0000 +++ apinger-0.6.1/src/apinger.c 2012-07-25 17:40:42.236091113 +0000 @@ -862,51 +862,6 @@ fclose(f); } -#ifdef FORKED_RECEIVER -int receiver_pipe=0; - -void pipe_reply(struct timeval time_recv,int icmp_seq,struct trace_info *ti){ -struct piped_info pi; - - pi.recv_timestamp=time_recv; - pi.icmp_seq=icmp_seq; - pi.ti=*ti; - write(receiver_pipe,&pi,sizeof(pi)); -} - -void receiver_loop(void){ -struct pollfd pfd[2]; -int npfd=0; -int i; - - signal(SIGTERM,SIG_DFL); - signal(SIGINT,SIG_DFL); - signal(SIGHUP,SIG_DFL); - signal(SIGUSR1,SIG_DFL); - signal(SIGPIPE,SIG_DFL); - - if (icmp_sock){ - pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL; - pfd[npfd].revents=0; - pfd[npfd++].fd=icmp_sock; - } - if (icmp6_sock){ - pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL; - pfd[npfd++].fd=icmp6_sock; - pfd[npfd].revents=0; - } - while(1){ - poll(pfd,npfd,-1); - for(i=0;istatus_interval){ gettimeofday(&cur_time,NULL); tv.tv_sec=config->status_interval/1000; @@ -1045,16 +972,8 @@ poll(pfd,npfd,timeout); for(i=0;iicmp_seq,(struct trace_info*)(icmp+1)); -#else analyze_reply(*time_recvp,icmp->icmp_seq,(struct trace_info*)(icmp+1)); -#endif } int make_icmp_socket(void){ diff -ur apinger-0.6.1.orig//src/icmp6.c apinger-0.6.1/src/icmp6.c --- apinger-0.6.1.orig//src/icmp6.c 2002-12-19 08:34:16.000000000 +0000 +++ apinger-0.6.1/src/icmp6.c 2012-07-25 17:40:42.237251321 +0000 @@ -192,11 +192,7 @@ debug("Packet data truncated."); return; } -#ifdef FORKED_RECEIVER - pipe_reply(*time_recvp,icmp->icmp6_seq,(struct trace_info*)(icmp+1)); -#else analyze_reply(*time_recvp,icmp->icmp6_seq,(struct trace_info*)(icmp+1)); -#endif } diff -ur apinger-0.6.1.orig//src/main.c apinger-0.6.1/src/main.c --- apinger-0.6.1.orig//src/main.c 2003-03-26 11:27:47.000000000 +0000 +++ apinger-0.6.1/src/main.c 2012-07-25 17:40:42.237251321 +0000 @@ -125,19 +125,6 @@ } } -#ifdef FORKED_RECEIVER -void sigchld_handler (int signum) { -int pid, status, serrno; - - serrno = errno; - while (1) { - pid = waitpid (WAIT_ANY, &status, WNOHANG); - if (pid <= 0) break; - } - errno = serrno; -} -#endif - void usage(const char *name){ fprintf(stderr,"Alarm Pinger " PACKAGE_VERSION " (c) 2002 Jacek Konieczny \n"); fprintf(stderr,"Usage:\n"); @@ -283,9 +270,6 @@ signal(SIGHUP,signal_handler); signal(SIGUSR1,signal_handler); signal(SIGPIPE,signal_handler); -#ifdef FORKED_RECEIVER - signal(SIGCHLD,sigchld_handler); -#endif main_loop(); if (icmp_sock>=0) close(icmp_sock); if (icmp6_sock>=0) close(icmp6_sock);