rfbLog("reset_rfbport: bad rfbport: %d\n", rp);
rfbLog("reset_rfbport: invalid rfbport: %d\n", rp);
void reset_rfbport(int old, int new)  {	int rp = new;	if (rp < 0) {		rfbLog("reset_rfbport: bad rfbport: %d\n", rp);	} else if (rp == old) {		rfbLog("reset_rfbport: unchanged rfbport: %d\n", rp);	} else if (inetd) {		rfbLog("reset_rfbport: cannot set rfbport: %d"		    " in inetd.\n", rp);	} else if (screen) {		rfbClientIteratorPtr iter;		rfbClientPtr cl;		int maxfd;		if (rp == 0) {			screen->autoPort = TRUE;		} else {			screen->autoPort = FALSE;		}		screen->port = rp;		screen->socketState = RFB_SOCKET_INIT;		if (screen->listenSock > -1) {			close(screen->listenSock);		}		rfbLog("reset_rfbport: setting rfbport %d -> %d.\n",		    old == -1 ? rp : old, rp);		rfbInitSockets(screen);		maxfd = screen->maxFd;		if (screen->udpSock > 0 && screen->udpSock > maxfd) {			maxfd = screen->udpSock;		}		iter = rfbGetClientIterator(screen);		while( (cl = rfbClientIteratorNext(iter)) ) {			if (cl->sock > -1) {				FD_SET(cl->sock, &(screen->allFds));				if (cl->sock > maxfd) {					maxfd = cl->sock;				}			}		}		rfbReleaseClientIterator(iter);		screen->maxFd = maxfd;		set_vnc_desktop_name();	}}