- if (::ioctl(m_source_fd, DMX_REMOVE_PID, pid))
- perror("DMX_REMOVE_PID");
+ while(true) {
+#if HAVE_DVB_API_VERSION > 3
+ __u16 p = pid;
+ if (::ioctl(m_source_fd, DMX_REMOVE_PID, &p) < 0) {
+#else
+ if (::ioctl(m_source_fd, DMX_REMOVE_PID, pid) < 0) {
+#endif
+ perror("DMX_REMOVE_PID");
+ if (errno == EAGAIN || errno == EINTR) {
+ eDebug("retry!");
+ continue;
+ }
+ }
+ break;
+ }