contrib/chg/chg.c
changeset 29357 66d41c9e9222
parent 29345 62b890496de5
child 29369 85a18f3c0bdd
equal deleted inserted replaced
29356:93b83ef78d1e 29357:66d41c9e9222
   248 	static const struct timespec sleepreq = {0, 10 * 1000000};
   248 	static const struct timespec sleepreq = {0, 10 * 1000000};
   249 	int pst = 0;
   249 	int pst = 0;
   250 
   250 
   251 	debugmsg("try connect to %s repeatedly", opts->sockname);
   251 	debugmsg("try connect to %s repeatedly", opts->sockname);
   252 
   252 
   253 	unsigned int timeoutsec = 10;  /* default: 10 seconds */
   253 	unsigned int timeoutsec = 60;  /* default: 60 seconds */
   254 	const char *timeoutenv = getenv("CHGTIMEOUT");
   254 	const char *timeoutenv = getenv("CHGTIMEOUT");
   255 	if (timeoutenv)
   255 	if (timeoutenv)
   256 		sscanf(timeoutenv, "%u", &timeoutsec);
   256 		sscanf(timeoutenv, "%u", &timeoutsec);
   257 
   257 
   258 	for (unsigned int i = 0; !timeoutsec || i < timeoutsec * 100; i++) {
   258 	for (unsigned int i = 0; !timeoutsec || i < timeoutsec * 100; i++) {