From 771c19a275a6f0a417866df962d1fab830758732 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 12 Nov 2007 16:16:23 +0000 Subject: [PATCH] --- .../platform_specific_code/juce_linux_Threads.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/linux/platform_specific_code/juce_linux_Threads.cpp b/build/linux/platform_specific_code/juce_linux_Threads.cpp index ba49bfb335..a282004c3c 100644 --- a/build/linux/platform_specific_code/juce_linux_Threads.cpp +++ b/build/linux/platform_specific_code/juce_linux_Threads.cpp @@ -347,13 +347,16 @@ bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw() if (testResult == 0) { - testResult = (ptrace (PTRACE_TRACEME, 0, 0, 0) < 0) ? 1 : -1; + testResult = (char) ptrace (PT_TRACE_ME, 0, 0, 0); - if (testResult < 0) - ptrace (PTRACE_DETACH, 0, (caddr_t) 1, 0); + if (testResult >= 0) + { + ptrace (PT_DETACH, 0, (caddr_t) 1, 0); + testResult = 1; + } } - return testResult > 0; + return testResult < 0; } bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw()