From 9c7ec619ca4cc42d0c7b4c516e8f7767fe3deb12 Mon Sep 17 00:00:00 2001 From: Cory Bloor Date: Mon, 5 Feb 2018 16:14:00 -0700 Subject: [PATCH] Speed up linux process connection There's no need to wait for exponential backoff to satisfy waitTime > MAX_WAIT_TIME if we already found the result. --- renderdoc/os/posix/linux/linux_process.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renderdoc/os/posix/linux/linux_process.cpp b/renderdoc/os/posix/linux/linux_process.cpp index f55d71ad0..7db6048cf 100644 --- a/renderdoc/os/posix/linux/linux_process.cpp +++ b/renderdoc/os/posix/linux/linux_process.cpp @@ -44,7 +44,7 @@ int GetIdentPort(pid_t childPid) int waitTime = INITIAL_WAIT_TIME; // try for a little while for the /proc entry to appear - while(waitTime <= MAX_WAIT_TIME) + while(ret == 0 && waitTime <= MAX_WAIT_TIME) { // back-off for each retry usleep(waitTime); @@ -75,7 +75,6 @@ int GetIdentPort(pid_t childPid) hexport <= RenderDoc_LastTargetControlPort) { ret = hexport; - break; } }