let ipkg fail when a package file to be installed is not found
[openwrt/staging/dedeckeh.git] / openwrt / package / l2tpns / patches / 01-honor_includes_remove_backtrace.patch
1 diff -urN orig/l2tpns-2.1.14/Makefile l2tpns-2.1.14/Makefile
2 --- orig/l2tpns-2.1.14/Makefile 2005-12-07 06:21:37.000000000 +0100
3 +++ l2tpns-2.1.14/Makefile 2005-12-14 12:50:49.000000000 +0100
4 @@ -11,17 +11,14 @@
5 DEFINES += -DETCDIR='"$(etcdir)"'
6
7 OPTIM =
8 -OPTIM += -g
9 OPTIM += -O3
10
11 -CC = gcc
12 -LD = gcc
13 -INCLUDES = -I.
14 +INCLUDES = -I. -I$(STAGING_DIR)/usr/include
15 CPPFLAGS = $(INCLUDES) $(DEFINES)
16 CFLAGS = -Wall -Wformat-security -Wno-format-zero-length $(OPTIM)
17 -LDFLAGS =
18 +LDFLAGS = -L$(STAGING_DIR)/usr/lib
19 LDLIBS =
20 -INSTALL = install -c -D -o root -g root
21 +INSTALL = install -c -D
22
23 l2tpns.LIBS = -lm -lcli -ldl
24
25 diff -urN orig/l2tpns-2.1.14/l2tpns.c l2tpns-2.1.14/l2tpns.c
26 --- orig/l2tpns-2.1.14/l2tpns.c 2005-12-07 06:21:37.000000000 +0100
27 +++ l2tpns-2.1.14/l2tpns.c 2005-12-14 12:50:36.000000000 +0100
28 @@ -940,18 +940,14 @@
29
30 if (!t)
31 {
32 - static int backtrace_count = 0;
33 LOG(0, 0, t, "tunnelsend called with 0 as tunnel id\n");
34 STAT(tunnel_tx_errors);
35 - log_backtrace(backtrace_count, 5)
36 return;
37 }
38
39 if (!tunnel[t].ip)
40 {
41 - static int backtrace_count = 0;
42 LOG(1, 0, t, "Error sending data out tunnel: no remote endpoint (tunnel not set up)\n");
43 - log_backtrace(backtrace_count, 5)
44 STAT(tunnel_tx_errors);
45 return;
46 }
47 @@ -4125,23 +4121,8 @@
48 struct sched_param params = {0};
49 params.sched_priority = 1;
50
51 - if (get_nprocs() < 2)
52 - {
53 - LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n");
54 - config->scheduler_fifo = 0;
55 - }
56 - else
57 - {
58 - if ((ret = sched_setscheduler(0, SCHED_FIFO, &params)) == 0)
59 - {
60 - LOG(1, 0, 0, "Using FIFO scheduler. Say goodbye to any other processes running\n");
61 - }
62 - else
63 - {
64 - LOG(0, 0, 0, "Error setting scheduler to FIFO: %s\n", strerror(errno));
65 - config->scheduler_fifo = 0;
66 - }
67 - }
68 + LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n");
69 + config->scheduler_fifo = 0;
70 }
71
72 /* Set up the cluster communications port. */
73 diff -urN orig/l2tpns-2.1.14/l2tpns.h l2tpns-2.1.14/l2tpns.h
74 --- orig/l2tpns-2.1.14/l2tpns.h 2005-12-09 01:43:17.000000000 +0100
75 +++ l2tpns-2.1.14/l2tpns.h 2005-12-14 07:43:51.000000000 +0100
76 @@ -5,7 +5,6 @@
77 #define __L2TPNS_H__
78
79 #include <netinet/in.h>
80 -#include <execinfo.h>
81 #include <stdio.h>
82 #include <signal.h>
83 #include <stdlib.h>
84 @@ -766,21 +765,6 @@
85 extern ippoolt *ip_address_pool;
86 #define sessionfree (session[0].next)
87
88 -#define log_backtrace(count, max) \
89 -if (count++ < max) { \
90 - void *array[20]; \
91 - char **strings; \
92 - int size, i; \
93 - LOG(0, 0, t, "Backtrace follows:\n"); \
94 - size = backtrace(array, 10); \
95 - strings = backtrace_symbols(array, size); \
96 - if (strings) for (i = 0; i < size; i++) \
97 - { \
98 - LOG(0, 0, t, " %s\n", strings[i]); \
99 - } \
100 - free(strings); \
101 -}
102 -
103
104 extern configt *config;
105 extern time_t basetime; // Time when this process started.
106 diff -urN orig/l2tpns-2.1.14/ppp.c l2tpns-2.1.14/ppp.c
107 --- orig/l2tpns-2.1.14/ppp.c 2005-12-07 06:21:37.000000000 +0100
108 +++ l2tpns-2.1.14/ppp.c 2005-12-14 07:43:08.000000000 +0100
109 @@ -1755,9 +1755,7 @@
110 {
111 if (size < 12) // Need more space than this!!
112 {
113 - static int backtrace_count = 0;
114 LOG(0, s, t, "makeppp buffer too small for L2TP header (size=%d)\n", size);
115 - log_backtrace(backtrace_count, 5)
116 return NULL;
117 }
118
119 @@ -1780,9 +1778,7 @@
120
121 if (l + 12 > size)
122 {
123 - static int backtrace_count = 0;
124 LOG(2, s, t, "makeppp would overflow buffer (size=%d, header+payload=%d)\n", size, l + 12);
125 - log_backtrace(backtrace_count, 5)
126 return NULL;
127 }
128