Project

General

Profile

0001-Disable-crashhandler-if-coredumps-are-enabled.patch

properly #ifndeffed for Q_OS_WIN32 now - dalbers, 05/19/2009 12:43 AM

View differences:

src/common/quassel.cpp
22 22

  
23 23
#include <iostream>
24 24
#include <signal.h>
25
#ifndef Q_OS_WIN32
26
#include <sys/resource.h>
27
#endif
25 28

  
26 29
#include <QCoreApplication>
27 30
#include <QDateTime>
......
55 58
  // we have crashhandler for win32 and unix (based on execinfo).
56 59
  // on mac os we use it's integrated backtrace generator
57 60
#if defined(Q_OS_WIN32) || (defined(HAVE_EXECINFO) && !defined(Q_OS_MAC))
58
  signal(SIGABRT, handleSignal);
59
  signal(SIGSEGV, handleSignal);
60
#  ifndef Q_OS_WIN32
61
  signal(SIGBUS, handleSignal);
62
#  endif
61

  
62
# ifndef Q_OS_WIN32
63
  // we only handle crashes ourselves if coredumps are disabled
64
  struct rlimit *limit = (rlimit *) malloc(sizeof(struct rlimit));
65
  int rc = getrlimit(RLIMIT_CORE, limit);
66

  
67
  if ( rc == -1 || !((long)limit->rlim_cur > 0 || limit->rlim_cur == RLIM_INFINITY) ) {
68
# endif
69
    signal(SIGABRT, handleSignal);
70
    signal(SIGSEGV, handleSignal);
71
#   ifndef Q_OS_WIN32
72
    signal(SIGBUS, handleSignal);
73
  }
74
  free(limit);
75
#   endif
76

  
63 77
#endif
64 78
}
65 79

  
66
-