mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Increase maximum wait time to find the target control port after launch
* Sometimes a process can take a while to start, this change waits up to 1+2+4+8+16+32+64 = 127 ms which is still not that much. * Also log a message if we still can't find it, so it's clear what the problem was.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
extern char **environ;
|
||||
|
||||
#define INITIAL_WAIT_TIME 1000
|
||||
#define MAX_WAIT_TIME 63000
|
||||
#define MAX_WAIT_TIME 64000
|
||||
|
||||
char **GetCurrentEnvironment()
|
||||
{
|
||||
@@ -45,7 +45,7 @@ int GetIdentPort(pid_t childPid)
|
||||
int totalWaitTime = 0;
|
||||
|
||||
// try for a little while for the /proc entry to appear
|
||||
while(totalWaitTime < MAX_WAIT_TIME)
|
||||
while(totalWaitTime <= MAX_WAIT_TIME)
|
||||
{
|
||||
// back-off for each retry
|
||||
usleep(waitTime);
|
||||
@@ -84,6 +84,13 @@ int GetIdentPort(pid_t childPid)
|
||||
FileIO::fclose(f);
|
||||
}
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
RDCWARN("Couldn't locate renderdoc target control listening port between %u and %u in %s",
|
||||
(uint32_t)RenderDoc_FirstTargetControlPort, (uint32_t)RenderDoc_LastTargetControlPort,
|
||||
procfile.c_str());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user