if (private.mouse_fd == -1) {
if (private.wsmouse_fd == -1) {
void InitInput(int argc, char *argv[]){	DeviceIntPtr mouse, keyboard;	DPRINTF(("InitInput\n"));	private.mouse_fd = -1;	private.wsmouse_fd = -1;	private.kbd_fd = -1;	private.wskbd_fd = -1;	private.beep_fd = -1;	/* Try to init the wsmouse device */	private.wsmouse_fd = wsmouse_init();	if (private.mouse_fd == -1) {		/* Try and init the old rpc mouse device */		private.mouse_fd = rpc_init_mouse();		if (private.mouse_fd == -1)			FatalError("Cannot open mouse device\n");	}		/* ... and wskbd */	private.wskbd_fd = wskbd_init();	if (private.wskbd_fd == -1) {		/* Try and init the old rpc kbd device */		private.kbd_fd = rpc_init_kbd();		if (private.kbd_fd == -1)			FatalError("Cannot open kbd device\n");		/* Try and init the old rpc beep device */		private.beep_fd = rpc_init_bell();		if (private.beep_fd == -1)			ErrorF("Cannot open beep device\n");	}	/* Add the input devices */	mouse = AddInputDevice((DeviceProc) vidc_mouse, TRUE);	keyboard = AddInputDevice((DeviceProc) vidc_kbd, TRUE);	if ((!mouse) || (!keyboard))		FatalError("failed to create input devices in InitInput\n");	private.mouse_dev = (DevicePtr) mouse;	private.kbd_dev = (DevicePtr) keyboard;	/* Register devices with the upper 'layers' (tangles) */	RegisterPointerDevice(mouse);	RegisterKeyboardDevice(keyboard);	miRegisterPointerDevice(screenInfo.screens[0], mouse);	if (!mieqInit(keyboard, mouse))		FatalError("mieqInit failed!!\n");	/* Start taking some SIGIOs on input device file descriptors. */	if (private.mouse_fd >= 0)		fcntl(private.mouse_fd, F_SETFL, O_ASYNC | O_NONBLOCK);	if (private.wsmouse_fd >= 0)		fcntl(private.wsmouse_fd, F_SETFL, O_ASYNC | O_NONBLOCK);       	if (private.kbd_fd >= 0)		fcntl(private.kbd_fd, F_SETFL, O_ASYNC | O_NONBLOCK);       	if (private.wskbd_fd >= 0)		fcntl(private.wskbd_fd, F_SETFL, O_ASYNC | O_NONBLOCK);	signal(SIGIO, sigio_handler);}