summaryrefslogtreecommitdiffstats
path: root/include/Makefile.am
diff options
context:
space:
mode:
authorGravatar Pavel Radzivilovsky2026-11-19 21:46:54 +0200
committerGravatar Pavel Radzivilovsky2026-11-19 21:46:54 +0200
commit1498dee3aadf66dbae10e699d71c62b428a511a3 (patch)
treef666f66fadaceaaf1378ffada69c5f4d9b8999c9 /include/Makefile.am
parentcf4b806dff1003e56b8219367bbb29cb01c3f619 (diff)
downloadlibusbmuxd-1498dee3aadf66dbae10e699d71c62b428a511a3.tar.gz
libusbmuxd-1498dee3aadf66dbae10e699d71c62b428a511a3.tar.bz2
inotify: use poll() instead of pselect() in usbmuxd_listen_inotify()HEADmaster
When usbmuxd isn't running, the device_monitor thread waits for the socket to appear by select()ing on an inotify fd. In a long-lived process with many open descriptors (e.g. KDE's kwin_wayland, which loads libusbmuxd via Solid's iMobileDevice backend), that fd can be >= FD_SETSIZE (1024). FD_SET() on it is undefined behaviour, and with _FORTIFY_SOURCE glibc aborts the whole process: *** bit out of range 0 - FD_SETSIZE on fd_set ***: terminated #8 __fortify_fail (libc) #9 usbmuxd_listen_inotify src/libusbmuxd.c:944 #10 device_monitor src/libusbmuxd.c:1130 Here this took down the Wayland compositor (and with it the whole desktop session) after ~4 weeks of uptime, when typing in the Overview search triggered a KRunner plugin that initialised Solid. poll() has no descriptor limit. This replaces the pselect() call with poll() on the inotify fd and the wake pipe; the pselect() fallback shim and the <sys/select.h> include become unused and are removed. libimobiledevice-glue's socket code already uses poll() on non-Windows platforms for the same reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/Makefile.am')
0 files changed, 0 insertions, 0 deletions