patch-crt_c 846 B

123456789101112131415161718192021222324252627282930
  1. --- htop-0.9.orig/CRT.c 2010-11-23 16:56:32.000000000 +0100
  2. +++ htop-0.9/CRT.c 2011-05-31 14:30:06.000000000 +0200
  3. @@ -11,7 +11,9 @@
  4. #include <signal.h>
  5. #include <stdlib.h>
  6. #include <stdbool.h>
  7. +#ifdef HAVE_EXECINFO_H
  8. #include <execinfo.h>
  9. +#endif
  10. #include "String.h"
  11. @@ -125,12 +127,14 @@
  12. CRT_done();
  13. #if __linux
  14. fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://htop.sf.net\n");
  15. - #else
  16. - fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
  17. - #endif
  18. + #ifdef HAVE_EXECINFO_H
  19. size_t size = backtrace(backtraceArray, sizeof(backtraceArray));
  20. fprintf(stderr, "Backtrace: \n");
  21. backtrace_symbols_fd(backtraceArray, size, 2);
  22. + #endif
  23. + #else
  24. + fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
  25. + #endif
  26. abort();
  27. }