camerad zmq_poll, also recover from EAGAIN

pull/1252/head
Willem Melching 5 years ago
parent 7cd2c4c18f
commit e69e0486ff
  1. 2
      selfdrive/camerad/cameras/camera_qcom.c
  2. 7
      selfdrive/camerad/main.cc
  3. 2
      selfdrive/ui/ui.cc

@ -2117,7 +2117,7 @@ void cameras_run(DualCameraState *s) {
int ret = poll(fds, ARRAYSIZE(fds), 1000); int ret = poll(fds, ARRAYSIZE(fds), 1000);
if (ret <= 0) { if (ret <= 0) {
if (errno == EINTR) continue; if (errno == EINTR || errno == EAGAIN) continue;
LOGE("poll failed (%d - %d)", ret, errno); LOGE("poll failed (%d - %d)", ret, errno);
break; break;
} }

@ -604,10 +604,7 @@ void* visionserver_client_thread(void* arg) {
} }
int ret = zmq_poll(polls, num_polls, -1); int ret = zmq_poll(polls, num_polls, -1);
if (ret < 0) { if (ret < 0) {
if (errno == EINTR){ if (errno == EINTR || errno == EAGAIN) continue;
LOGW("poll EINTR");
continue;
}
LOGE("poll failed (%d - %d)", ret, errno); LOGE("poll failed (%d - %d)", ret, errno);
break; break;
} }
@ -799,7 +796,7 @@ void* visionserver_thread(void* arg) {
int ret = zmq_poll(polls, ARRAYSIZE(polls), -1); int ret = zmq_poll(polls, ARRAYSIZE(polls), -1);
if (ret < 0) { if (ret < 0) {
if (errno == EINTR) continue; if (errno == EINTR || errno == EAGAIN) continue;
LOGE("poll failed (%d - %d)", ret, errno); LOGE("poll failed (%d - %d)", ret, errno);
break; break;
} }

@ -598,7 +598,7 @@ static void ui_update(UIState *s) {
int ret = zmq_poll(polls, 1, 1000); int ret = zmq_poll(polls, 1, 1000);
#endif #endif
if (ret < 0) { if (ret < 0) {
if (errno == EINTR) continue; if (errno == EINTR || errno == EAGAIN) continue;
LOGE("poll failed (%d - %d)", ret, errno); LOGE("poll failed (%d - %d)", ret, errno);
close(s->ipc_fd); close(s->ipc_fd);

Loading…
Cancel
Save