}
if (tmp.cmd_type == STOP) {
DBG("Received STOP command");
- quit = 1;
goto end;
}
/* we received a command to add or update fds */
end:
DBG("thread_receive_fds exiting");
+ quit = 1;
+ ret = write(poll_pipe[1], "4", 1);
+ if (ret < 0) {
+ perror("poll pipe write");
+ }
return NULL;
}
goto end;
}
+ /* No FDs and quit, cleanup the thread */
+ if (nb_fd == 0 && quit == 1) {
+ goto end;
+ }
+
/*
* if only the poll_pipe triggered poll to return just return to the
* beginning of the loop to update the array