| 96 | } |
| 97 | |
| 98 | void write_evdev(struct input_event ev, int evnum) |
| 99 | { |
| 100 | if (evdevfds[evnum].second == 0) |
| 101 | return; |
| 102 | |
| 103 | /* Check pipe size and don't write if too big */ |
| 104 | int pipeSize; |
| 105 | NATIVECALL(MYASSERT(ioctl(evdevfds[evnum].first.first, FIONREAD, &pipeSize) == 0)); |
| 106 | |
| 107 | if (pipeSize < static_cast<int>(64*sizeof(ev))) |
| 108 | write(evdevfds[evnum].first.second, &ev, sizeof(ev)); |
| 109 | else { |
| 110 | LOG(LL_WARN, LCF_JOYSTICK, "did not write evdev event, too many already."); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | bool sync_evdev(int evnum) |
| 115 | { |
no test coverage detected