| 96 | } |
| 97 | |
| 98 | int _rmnotifynode(usbdevice* kb, int notify){ |
| 99 | if(notify < 0 || notify >= OUTFIFO_MAX || !kb->outfifo[notify]) |
| 100 | return -1; |
| 101 | int index = INDEX_OF(kb, keyboard); |
| 102 | char outpath[strlen(devpath) + 10]; |
| 103 | snprintf(outpath, sizeof(outpath), "%s%d/notify%d", devpath, index, notify); |
| 104 | // Close FIFO |
| 105 | close(kb->outfifo[notify] - 1); |
| 106 | kb->outfifo[notify] = 0; |
| 107 | // Delete node |
| 108 | int res = remove(outpath); |
| 109 | return res; |
| 110 | } |
| 111 | |
| 112 | int rmnotifynode(usbdevice* kb, int notify){ |
| 113 | euid_guard_start; |
no outgoing calls
no test coverage detected