]> git.pld-linux.org Git - packages/apinger.git/blob - apinger-no_forked_receiver.patch
- disable parallel build
[packages/apinger.git] / apinger-no_forked_receiver.patch
1 diff -ur apinger-0.6.1.orig//config.h.in apinger-0.6.1/config.h.in
2 --- apinger-0.6.1.orig//config.h.in     2003-03-26 11:37:48.000000000 +0000
3 +++ apinger-0.6.1/config.h.in   2012-07-25 17:40:42.232252511 +0000
4 @@ -1,8 +1,5 @@
5  /* config.h.in.  Generated from configure.ac by autoheader.  */
6  
7 -/* Define to enable receiver subprocess */
8 -#undef FORKED_RECEIVER
9 -
10  /* Define to 1 if you have the `access' function. */
11  #undef HAVE_ACCESS
12  
13 diff -ur apinger-0.6.1.orig//configure apinger-0.6.1/configure
14 --- apinger-0.6.1.orig//configure       2003-03-26 11:37:37.000000000 +0000
15 +++ apinger-0.6.1/configure     2012-07-25 17:40:42.235252628 +0000
16 @@ -851,8 +851,6 @@
17    --disable-dependency-tracking Speeds up one-time builds
18    --enable-dependency-tracking  Do not reject slow dependency extractors
19    --disable-ipv6          Disable IPv6 support.
20 -  --enable-forked-receiver
21 -                          Create subprocess for receiving pings.
22  
23  Optional Packages:
24    --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
25 @@ -7132,23 +7130,6 @@
26  done
27  
28  
29 -# Check whether --enable-forked-receiver or --disable-forked-receiver was given.
30 -if test "${enable_forked_receiver+set}" = set; then
31 -  enableval="$enable_forked_receiver"
32 -
33 -else
34 -  enable_forked_receiver=no
35 -fi;
36 -
37 -if test "x$enable_forked_receiver" = "xyes" ; then
38 -
39 -cat >>confdefs.h <<\_ACEOF
40 -#define FORKED_RECEIVER
41 -_ACEOF
42 -
43 -fi
44 -
45 -
46  # Check whether --with-rrdtool or --without-rrdtool was given.
47  if test "${with_rrdtool+set}" = set; then
48    withval="$with_rrdtool"
49 diff -ur apinger-0.6.1.orig//configure.ac apinger-0.6.1/configure.ac
50 --- apinger-0.6.1.orig//configure.ac    2003-03-26 11:37:16.000000000 +0000
51 +++ apinger-0.6.1/configure.ac  2012-07-25 17:40:42.235252628 +0000
52 @@ -56,34 +56,6 @@
53  
54  AC_CHECK_FUNCS([sched_yield recvmsg])
55  
56 -AC_ARG_ENABLE(forked-receiver,[AC_HELP_STRING([--enable-forked-receiver],
57 -                               [Create subprocess for receiving pings.])],
58 -                                       [],[enable_forked_receiver=no])
59 -
60 -if test "x$enable_forked_receiver" = "xyes" ; then
61 -       AC_DEFINE(FORKED_RECEIVER,[],[Define to enable receiver subprocess])
62 -dnl else 
63 -dnl    AC_MSG_CHECKING([if PIPE_BUF is big enough])
64 -dnl    if test "x$enable_forked_receiver" != "xno" ; then
65 -dnl            AC_TRY_RUN([
66 -dnl #ifdef HAVE_SYS_TYPES_H
67 -dnl # include <sys/types.h>
68 -dnl #endif
69 -dnl #ifdef HAVE_LIMITS_H
70 -dnl # include <limits.h>
71 -dnl #endif
72 -dnl 
73 -dnl int main(int argc,char **argv){
74 -dnl    
75 -dnl    if (PIPE_BUF<1024) return 1;
76 -dnl    return 0;
77 -dnl }],
78 -dnl            [AC_DEFINE(FORKED_RECEIVER,[1],[Define to enable receiver subprocess])
79 -dnl            AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])
80 -dnl                                    AC_MSG_WARN([Receiver subprocess will not be used.])])
81 -dnl    fi
82 -fi
83 -
84  AC_ARG_WITH(rrdtool,[AC_HELP_STRING([--with-rrdtool=path],[Location of rrdtool program])],
85         [ RRDTOOL="$withval" ],[ AC_PATH_PROG([RRDTOOL],[rrdtool],[rrdtool]) ])
86  AC_ARG_WITH(rrdcgi,[AC_HELP_STRING([--with-rrdcgi=path],[Location of rrdcgi program])],
87 diff -ur apinger-0.6.1.orig//src/apinger.c apinger-0.6.1/src/apinger.c
88 --- apinger-0.6.1.orig//src/apinger.c   2012-07-25 17:39:57.000000000 +0000
89 +++ apinger-0.6.1/src/apinger.c 2012-07-25 17:40:42.236091113 +0000
90 @@ -862,51 +862,6 @@
91         fclose(f);
92  }
93  
94 -#ifdef FORKED_RECEIVER
95 -int receiver_pipe=0;
96 -
97 -void pipe_reply(struct timeval time_recv,int icmp_seq,struct trace_info *ti){
98 -struct piped_info pi;
99 -
100 -       pi.recv_timestamp=time_recv;
101 -       pi.icmp_seq=icmp_seq;
102 -       pi.ti=*ti;
103 -       write(receiver_pipe,&pi,sizeof(pi));
104 -}
105 -
106 -void receiver_loop(void){
107 -struct pollfd pfd[2];
108 -int npfd=0;
109 -int i;
110 -
111 -       signal(SIGTERM,SIG_DFL);
112 -       signal(SIGINT,SIG_DFL);
113 -       signal(SIGHUP,SIG_DFL);
114 -       signal(SIGUSR1,SIG_DFL);
115 -       signal(SIGPIPE,SIG_DFL);
116 -       
117 -       if (icmp_sock){
118 -               pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
119 -               pfd[npfd].revents=0;
120 -               pfd[npfd++].fd=icmp_sock;
121 -       }
122 -       if (icmp6_sock){
123 -               pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
124 -               pfd[npfd++].fd=icmp6_sock;
125 -               pfd[npfd].revents=0;
126 -       }
127 -       while(1){
128 -               poll(pfd,npfd,-1);
129 -               for(i=0;i<npfd;i++){
130 -                       if (!pfd[i].revents&POLLIN) continue;
131 -                       if (pfd[i].fd==icmp_sock) recv_icmp();
132 -                       else if (pfd[i].fd==icmp6_sock) recv_icmp6();
133 -                       pfd[i].revents=0;
134 -               }
135 -       };
136 -}
137 -#endif
138 -
139  void main_loop(void){
140  struct target *t;
141  struct timeval cur_time,next_status={0,0},tv,next_report={0,0},next_rrd_update={0,0};
142 @@ -919,35 +874,8 @@
143  struct alarm_list *al,*nal;
144  struct active_alarm_list *aal;
145  struct alarm_cfg *a;
146 -#ifdef FORKED_RECEIVER
147 -int recv_pipe[2];
148 -int pid,r;
149 -struct piped_info pi;
150 -#endif
151  
152         configure_targets();
153 -#ifdef FORKED_RECEIVER
154 -       r=pipe(recv_pipe);
155 -       if (r){
156 -               myperror("pipe");
157 -               exit(1);
158 -       }
159 -       pid=fork();
160 -       if (pid==-1){
161 -               myperror("pipe");
162 -               exit(1);
163 -       }
164 -       else if (pid==0){
165 -               close(recv_pipe[0]);
166 -               receiver_pipe=recv_pipe[1];
167 -               receiver_loop();
168 -               exit(0);
169 -       }
170 -       close(recv_pipe[1]);
171 -       pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
172 -       pfd[npfd].revents=0;
173 -       pfd[npfd++].fd=recv_pipe[0];
174 -#else
175         if (icmp_sock){
176                 pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
177                 pfd[npfd].revents=0;
178 @@ -958,7 +886,6 @@
179                 pfd[npfd++].fd=icmp6_sock;
180                 pfd[npfd].revents=0;
181         }
182 -#endif
183         if (config->status_interval){
184                 gettimeofday(&cur_time,NULL);
185                 tv.tv_sec=config->status_interval/1000;
186 @@ -1045,16 +972,8 @@
187                 poll(pfd,npfd,timeout);
188                 for(i=0;i<npfd;i++){
189                         if (!pfd[i].revents&POLLIN) continue;
190 -#ifdef FORKED_RECEIVER
191 -                       if (pfd[i].fd==recv_pipe[0]){
192 -                               r=read(recv_pipe[0],&pi,sizeof(pi));
193 -                               if (r==sizeof(pi))
194 -                                       analyze_reply(pi.recv_timestamp,pi.icmp_seq,&pi.ti);
195 -                       }
196 -#else
197                         if (pfd[i].fd==icmp_sock) recv_icmp();
198                         else if (pfd[i].fd==icmp6_sock) recv_icmp6();
199 -#endif
200                         pfd[i].revents=0;
201                 }
202                 if (status_request){
203 @@ -1070,9 +989,6 @@
204                         reload_config();
205                 }
206         }
207 -#ifdef FORKED_RECEIVER
208 -       kill(pid,SIGTERM);
209 -#endif
210         while(delayed_reports!=NULL) make_delayed_reports();
211         free_targets();
212         if (macros_buf!=NULL) free(macros_buf);
213 diff -ur apinger-0.6.1.orig//src/apinger.h apinger-0.6.1/src/apinger.h
214 --- apinger-0.6.1.orig//src/apinger.h   2002-12-20 09:19:57.000000000 +0000
215 +++ apinger-0.6.1/src/apinger.h 2012-07-25 17:40:42.236091113 +0000
216 @@ -104,14 +104,6 @@
217         void *target_id;
218  };
219  
220 -#ifdef FORKED_RECEIVER
221 -struct piped_info {
222 -       struct trace_info ti;
223 -       int icmp_seq;
224 -       struct timeval recv_timestamp;
225 -};
226 -#endif
227 -
228  struct target *targets;
229  
230  extern int foreground;
231 @@ -131,9 +123,6 @@
232  void recv_icmp6(void);
233  void send_icmp6_probe(struct target *t,int seq);
234  
235 -#ifdef FORKED_RECEIVER
236 -void pipe_reply(struct timeval time_recv,int seq,struct trace_info *ti);
237 -#endif
238  void analyze_reply(struct timeval time_recv,int seq,struct trace_info *ti);
239  void main_loop(void);
240  
241 diff -ur apinger-0.6.1.orig//src/icmp.c apinger-0.6.1/src/icmp.c
242 --- apinger-0.6.1.orig//src/icmp.c      2002-12-19 08:24:33.000000000 +0000
243 +++ apinger-0.6.1/src/icmp.c    2012-07-25 17:40:42.237251321 +0000
244 @@ -236,11 +236,7 @@
245                 debug("Packet data truncated.");
246                 return;
247         }
248 -#ifdef FORKED_RECEIVER
249 -       pipe_reply(*time_recvp,icmp->icmp_seq,(struct trace_info*)(icmp+1));
250 -#else
251         analyze_reply(*time_recvp,icmp->icmp_seq,(struct trace_info*)(icmp+1));
252 -#endif
253  }
254  
255  int make_icmp_socket(void){
256 diff -ur apinger-0.6.1.orig//src/icmp6.c apinger-0.6.1/src/icmp6.c
257 --- apinger-0.6.1.orig//src/icmp6.c     2002-12-19 08:34:16.000000000 +0000
258 +++ apinger-0.6.1/src/icmp6.c   2012-07-25 17:40:42.237251321 +0000
259 @@ -192,11 +192,7 @@
260                 debug("Packet data truncated.");
261                 return;
262         }
263 -#ifdef FORKED_RECEIVER
264 -       pipe_reply(*time_recvp,icmp->icmp6_seq,(struct trace_info*)(icmp+1));
265 -#else
266         analyze_reply(*time_recvp,icmp->icmp6_seq,(struct trace_info*)(icmp+1));
267 -#endif
268  }
269  
270  
271 diff -ur apinger-0.6.1.orig//src/main.c apinger-0.6.1/src/main.c
272 --- apinger-0.6.1.orig//src/main.c      2003-03-26 11:27:47.000000000 +0000
273 +++ apinger-0.6.1/src/main.c    2012-07-25 17:40:42.237251321 +0000
274 @@ -125,19 +125,6 @@
275         }
276  }
277  
278 -#ifdef FORKED_RECEIVER
279 -void sigchld_handler (int signum) {
280 -int pid, status, serrno;
281 -
282 -       serrno = errno;
283 -       while (1) {
284 -                  pid = waitpid (WAIT_ANY, &status, WNOHANG);
285 -                  if (pid <= 0) break;
286 -       }
287 -       errno = serrno;
288 -}
289 -#endif
290 -
291  void usage(const char *name){
292         fprintf(stderr,"Alarm Pinger " PACKAGE_VERSION " (c) 2002 Jacek Konieczny <jajcus@pld.org.pl>\n");
293         fprintf(stderr,"Usage:\n");
294 @@ -283,9 +270,6 @@
295         signal(SIGHUP,signal_handler);
296         signal(SIGUSR1,signal_handler);
297         signal(SIGPIPE,signal_handler);
298 -#ifdef FORKED_RECEIVER
299 -       signal(SIGCHLD,sigchld_handler);
300 -#endif
301         main_loop();
302         if (icmp_sock>=0) close(icmp_sock);
303         if (icmp6_sock>=0) close(icmp6_sock);
This page took 0.17728 seconds and 3 git commands to generate.