add packages_10.03.2 in preparation for the 10.03.2 interim release
[10.03/packages.git] / admin / htop / patches / 001-uClibc-friendly.patch
1 --- a/CRT.c
2 +++ b/CRT.c
3 @@ -11,7 +11,9 @@ in the source distribution for its full
4  #include <signal.h>
5  #include <stdlib.h>
6  #include <stdbool.h>
7 +#ifdef HAVE_EXECINFO_H
8  #include <execinfo.h>
9 +#endif
10  
11  #include "String.h"
12  
13 @@ -125,12 +127,14 @@ static void CRT_handleSIGSEGV(int sgn) {
14     CRT_done();
15     #if __linux
16     fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://htop.sf.net\n");
17 -   #else
18 -   fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
19 -   #endif
20 +   #ifdef HAVE_EXECINFO_H
21     size_t size = backtrace(backtraceArray, sizeof(backtraceArray));
22     fprintf(stderr, "Backtrace: \n");
23     backtrace_symbols_fd(backtraceArray, size, 2);
24 +   #endif
25 +   #else
26 +   fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
27 +   #endif
28     abort();
29  }
30  
31 --- a/CRT.h
32 +++ b/CRT.h
33 @@ -14,7 +14,9 @@ in the source distribution for its full
34  #include <signal.h>
35  #include <stdlib.h>
36  #include <stdbool.h>
37 +#ifdef HAVE_EXECINFO_H
38  #include <execinfo.h>
39 +#endif
40  
41  #include "String.h"
42  
43 --- a/configure.ac
44 +++ b/configure.ac
45 @@ -25,6 +25,7 @@ AC_HEADER_STDC
46  AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h curses.h],[:],[
47    missing_headers="$missing_headers $ac_header"
48  ])
49 +AC_CHECK_HEADERS([execinfo.h],[:],[:])
50  
51  # Checks for typedefs, structures, and compiler characteristics.
52  AC_HEADER_STDBOOL