client_connect = str;
static void check_connect_file(char *file) {	FILE *in;	char line[1024], host[1024];	static int first_warn = 1, truncate_ok = 1;	static time_t last_time = 0; 	time_t now = time(0);	if (now - last_time < 1) {		/* check only once a second */		return;	}	last_time = now;	if (! truncate_ok) {		/* check if permissions changed */		if (access(file, W_OK) == 0) {			truncate_ok = 1;		} else {			return;		}	}	in = fopen(file, "r");	if (in == NULL) {		if (first_warn) {			rfbLog("check_connect_file: fopen failure: %s\n", file);			rfbLogPerror("fopen");			first_warn = 0;		}		return;	}	if (fgets(line, 1024, in) != NULL) {		if (sscanf(line, "%s", host) == 1) {			if (strlen(host) > 0) {				client_connect = strdup(host);				rfbLog("read connect file: %s\n", host);			}		}	}	fclose(in);	/* truncate file */	in = fopen(file, "w");	if (in != NULL) {		fclose(in);	} else {		/* disable if we cannot truncate */		rfbLog("check_connect_file: could not truncate %s, "		   "disabling checking.\n", file);		truncate_ok = 0;	}}