- fix for #231
This commit is contained in:
Phil Nash 2014-01-08 17:17:31 +00:00
parent 46a1fc7615
commit 7eb5acc183
4 changed files with 18 additions and 17 deletions

View file

@ -30,7 +30,6 @@
// running under the debugger or has a debugger attached post facto).
bool isDebuggerActive(){
int junk;
int mib[4];
struct kinfo_proc info;
size_t size;
@ -51,8 +50,10 @@
// Call sysctl.
size = sizeof(info);
junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
assert(junk == 0);
if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) != 0 ) {
std::cerr << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl;
return false;
}
// We're being debugged if the P_TRACED flag is set.