From 8f3a276cf931944f8a22f8c475d352b8b630089e Mon Sep 17 00:00:00 2001 From: leberus Date: Thu, 12 Jan 2017 11:19:47 +0100 Subject: [PATCH] Fix: *BSD build (#6494) --- libr/debug/p/debug_native.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libr/debug/p/debug_native.c b/libr/debug/p/debug_native.c index 47b05868ef..f572b4a6fb 100755 --- a/libr/debug/p/debug_native.c +++ b/libr/debug/p/debug_native.c @@ -352,15 +352,14 @@ static RDebugReasonType r_debug_native_wait (RDebug *dbg, int pid) { // eprintf ("No waitpid here :D\n"); reason = xnu_wait (dbg, pid); status = reason? 1: 0; +#else +#if __linux__ && !defined (WAIT_ON_ALL_CHILDREN) + reason = linux_dbg_wait (dbg, dbg->tid); #else // XXX: this is blocking, ^C will be ignored #ifdef WAIT_ON_ALL_CHILDREN int ret = waitpid (-1, &status, WAITPID_FLAGS); #else - reason = linux_dbg_wait (dbg, dbg->tid); - dbg->reason.tid = pid; - dbg->reason.type = reason; - return reason; int ret = waitpid (pid, &status, WAITPID_FLAGS); #endif // WAIT_ON_ALL_CHILDREN if (ret == -1) { @@ -436,6 +435,7 @@ static RDebugReasonType r_debug_native_wait (RDebug *dbg, int pid) { eprintf ("%s: no idea what happened... wtf?!?!\n", __func__); reason = R_DEBUG_REASON_ERROR; } +#endif // __linux__ && !defined (WAIT_ON_ALL_CHILDREN) #endif // __APPLE__ #endif // __WINDOWS__ && !__CYGWIN__ dbg->reason.tid = pid;