Make the linux timeout even more generous still

* It's not too bad to wait a while since we have a progress bar that
  will pop up if the operation takes a while.
This commit is contained in:
baldurk
2017-05-19 15:57:58 +01:00
parent 57831f1926
commit 9b41534daa
+2 -4
View File
@@ -28,7 +28,7 @@
extern char **environ;
#define INITIAL_WAIT_TIME 1000
#define MAX_WAIT_TIME 64000
#define MAX_WAIT_TIME 128000
char **GetCurrentEnvironment()
{
@@ -42,15 +42,13 @@ int GetIdentPort(pid_t childPid)
string procfile = StringFormat::Fmt("/proc/%d/net/tcp", (int)childPid);
int waitTime = INITIAL_WAIT_TIME;
int totalWaitTime = 0;
// try for a little while for the /proc entry to appear
while(totalWaitTime <= MAX_WAIT_TIME)
while(waitTime <= MAX_WAIT_TIME)
{
// back-off for each retry
usleep(waitTime);
totalWaitTime += waitTime;
waitTime *= 2;
FILE *f = FileIO::fopen(procfile.c_str(), "r");