Branch oldpackages for 14.07
[14.07/packages.git] / net / hsflowd / patches / 200-uclibc-compat.patch
1 --- a/src/Linux/hsflowd.c
2 +++ b/src/Linux/hsflowd.c
3 @@ -1408,13 +1408,12 @@ extern "C" {
4         signal(SIGXFSZ, SIG_DFL);
5  
6         // ask for the backtrace pointers
7 -       size_t siz = backtrace(backtracePtrs, HSP_NUM_BACKTRACE_PTRS);
8 +       size_t siz = 0;
9  
10         if(f_crash == NULL) {
11           f_crash = stderr;
12         }
13  
14 -       backtrace_symbols_fd(backtracePtrs, siz, fileno(f_crash));
15         fflush(f_crash);
16         // Do something useful with siginfo_t 
17         if (sig == SIGSEGV) {
18 @@ -1430,7 +1429,6 @@ extern "C" {
19         // overwrite sigaction with caller's address
20         backtracePtrs[1] = (void *)(((ucontext_t *)secret)->uc_mcontext.gregs[REG_EIP]);
21         // then write again:
22 -       backtrace_symbols_fd(backtracePtrs, siz, fileno(f_crash));
23         fflush(f_crash);
24  #endif
25         // exit with the original signal so we get the right idea
26 @@ -2005,7 +2003,6 @@ extern "C" {
27               if(debug) {
28                 myLog(LOG_INFO, "initAgent suceeded");
29                 // print some stats to help us size HSP_RLIMIT_MEMLOCK etc.
30 -               malloc_stats();
31               }
32  
33               if(sp->dropPriv) {
34 --- a/src/Linux/hsflowd.h
35 +++ b/src/Linux/hsflowd.h
36 @@ -34,9 +34,7 @@ extern "C" {
37  #include <limits.h> // for UINT_MAX
38  
39  // for signal backtrace
40 -#include <execinfo.h>
41  #include <signal.h>
42 -#include <ucontext.h>
43  
44  #include <stdarg.h> // for va_start()
45  #include "util.h"
46 --- a/src/Linux/util.c
47 +++ b/src/Linux/util.c
48 @@ -39,7 +39,6 @@ extern "C" {
49      void *mem = SYS_CALLOC(1, bytes);
50      if(mem == NULL) {
51        myLog(LOG_ERR, "calloc() failed : %s", strerror(errno));
52 -      if(debug) malloc_stats();
53        exit(EXIT_FAILURE);
54      }
55      return mem;
56 @@ -51,7 +50,6 @@ extern "C" {
57      void *mem = SYS_REALLOC(ptr, bytes);
58      if(mem == NULL) {
59        myLog(LOG_ERR, "realloc() failed : %s", strerror(errno));
60 -      if(debug) malloc_stats();
61        exit(EXIT_FAILURE);
62      }
63      return mem;