Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e4c257b authored by Chris Manton's avatar Chris Manton
Browse files

Skip service of poll sockets that are no longer registered

Bug: 175911101
Tag: #refactor
Test: gd/cert/run
Change-Id: Ib817288793a715e08a3fb47914379e0cab093d62
parent 9d718b1d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -448,6 +448,10 @@ static void process_data_sock(int h, struct pollfd* pfds, int count) {
  for (i = 1; i < ts[h].poll_count; i++) {
    if (pfds[i].revents) {
      int ps_i = ts[h].psi[i];
      if (ts[h].ps[ps_i].pfd.fd == -1) {
        LOG_INFO("Socket has been removed from poll set");
        continue;
      }
      asrt(pfds[i].fd == ts[h].ps[ps_i].pfd.fd);
      uint32_t user_id = ts[h].ps[ps_i].user_id;
      int type = ts[h].ps[ps_i].type;