FatalError("Can't set keyboard mode\n");
hpcFatalError(("Can't set keyboard mode\n"));
hpcKbdProc(device, what)    DeviceIntPtr  device;	/* Keyboard to manipulate */    int	    	  what;	    	/* What to do to it */{    int i;    DevicePtr pKeyboard = (DevicePtr) device;    hpcKbdPrivPtr pPriv;    KeybdCtrl*	ctrl = &device->kbdfeed->ctrl;    extern int XkbDfltRepeatDelay, XkbDfltRepeatInterval;    struct termios tkbdtty;    static CARD8 *workingModMap = NULL;    static KeySymsRec *workingKeySyms;    switch (what) {    case DEVICE_INIT:	if (pKeyboard != LookupKeyboardDevice()) {	    ErrorF ("Cannot open non-system keyboard\n");	    return (!Success);	}	if (!workingKeySyms) {	    workingKeySyms = &hpcKeySyms[hpcKbdPriv.type];#if MIN_KEYCODE > 0	    if (workingKeySyms->minKeyCode < MIN_KEYCODE) {		workingKeySyms->minKeyCode += MIN_KEYCODE;		workingKeySyms->maxKeyCode += MIN_KEYCODE;	    }#endif	    if (workingKeySyms->maxKeyCode > MAX_KEYCODE)		workingKeySyms->maxKeyCode = MAX_KEYCODE;	}	if (!workingModMap) {	    workingModMap=(CARD8 *)xalloc(MAP_LENGTH);	    (void) memset(workingModMap, 0, MAP_LENGTH);	    for (i = 0; hpcModMaps[hpcKbdPriv.type][i].key != 0; i++)		workingModMap[hpcModMaps[hpcKbdPriv.type][i].key + MIN_KEYCODE] =		    hpcModMaps[hpcKbdPriv.type][i].modifiers;	}	(void) memset ((void *) defaultKeyboardControl.autoRepeats,			~0, sizeof defaultKeyboardControl.autoRepeats);#if 0 /* XXX */#ifdef XKB	if (noXkbExtension) {	    hpcAutoRepeatInitiate = XkbDfltRepeatDelay * 1000;	    hpcAutoRepeatDelay = XkbDfltRepeatInterval * 1000;#endif	autoRepeatKeyDown = 0;#ifdef XKB	}#endif#endif /* 0 XXX */	pKeyboard->devicePrivate = (pointer)&hpcKbdPriv;	pKeyboard->on = FALSE;	InitKeyboardDeviceStruct(pKeyboard,				 workingKeySyms, workingModMap,				 hpcBell, hpcKbdCtrl);	break;    case DEVICE_ON:	if (!hpcKbdPriv.bedev) {	    hpcKbdPriv.bedev = (hpcPtrPrivPtr)(((DeviceIntPtr)             LookupPointerDevice())->public.devicePrivate);	    if (hpcKbdPriv.bedev)		hpcKbdPriv.bedev->bedev = &hpcKbdPriv;	}	hpcKbdPriv.bkeydown = 0;	hpcKbdPriv.bkeymask = 0;	hpcKbdPriv.bkeynrmask = 0;	pPriv = (hpcKbdPrivPtr)pKeyboard->devicePrivate;	switch (pPriv->devtype) {	case HPC_KBDDEV_RAW:	    pPriv->xlatestat = HPC_KBDXSTAT_INIT;	    if (ioctl(pPriv->fd, KDSKBMODE, K_RAW) < 0) {		FatalError("Can't set keyboard mode\n");	    }	    tcgetattr(pPriv->fd, &pPriv->kbdtty);	    tkbdtty = pPriv->kbdtty;	    tkbdtty.c_iflag = IGNPAR | IGNBRK;	    tkbdtty.c_oflag = 0;	    tkbdtty.c_cflag = CREAD | CS8;	    tkbdtty.c_lflag = 0;	    tkbdtty.c_cc[VTIME] = 0;	    tkbdtty.c_cc[VMIN] = 1;	    cfsetispeed(&tkbdtty, 9600);	    cfsetospeed(&tkbdtty, 9600);	    tcsetattr(pPriv->fd, TCSANOW, &tkbdtty);	    break;	case HPC_KBDDEV_WSKBD:	case HPC_KBDDEV_WSMUX:	}	hpcCleanupFd(pPriv->fd);	AddEnabledDevice(pPriv->fd);	pKeyboard->on = TRUE;	break;    case DEVICE_CLOSE:    case DEVICE_OFF:	pPriv = (hpcKbdPrivPtr)pKeyboard->devicePrivate;	RemoveEnabledDevice(pPriv->fd);	pKeyboard->on = FALSE;	switch (pPriv->devtype) {	case HPC_KBDDEV_RAW:	    if (ioctl(pPriv->fd, KDSKBMODE, K_XLATE) < 0) {		Error("Can't set keyboard mode\n");	    }	    tcsetattr(pPriv->fd, TCSANOW, &pPriv->kbdtty);	    break;	case HPC_KBDDEV_WSKBD:	case HPC_KBDDEV_WSMUX:	}	break;    default:	FatalError("Unknown keyboard operation\n");    }    return Success;}