Show More
@@ -28,3 +28,5 b' The following variables are available fo' | |||
|
28 | 28 | |
|
29 | 29 | * CHGDEBUG enables debug messages. |
|
30 | 30 | * CHGSOCKNAME specifies the socket path of the background cmdserver. |
|
31 | * CHGTIMEOUT specifies how many seconds chg will wait before giving up | |
|
32 | connecting to a cmdserver. If it is 0, chg will wait forever. Default: 10 |
@@ -249,7 +249,13 b' static hgclient_t *retryconnectcmdserver' | |||
|
249 | 249 | int pst = 0; |
|
250 | 250 | |
|
251 | 251 | debugmsg("try connect to %s repeatedly", opts->sockname); |
|
252 | for (unsigned int i = 0; i < 10 * 100; i++) { | |
|
252 | ||
|
253 | unsigned int timeoutsec = 10; /* default: 10 seconds */ | |
|
254 | const char *timeoutenv = getenv("CHGTIMEOUT"); | |
|
255 | if (timeoutenv) | |
|
256 | sscanf(timeoutenv, "%u", &timeoutsec); | |
|
257 | ||
|
258 | for (unsigned int i = 0; !timeoutsec || i < timeoutsec * 100; i++) { | |
|
253 | 259 | hgclient_t *hgc = hgc_open(opts->sockname); |
|
254 | 260 | if (hgc) |
|
255 | 261 | return hgc; |
General Comments 0
You need to be logged in to leave comments.
Login now