summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7d05103)
When updating the pollfd array, the wrong pollfd size was used so at
multiple UST registration at the same time the socket was not added to
the poll list.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
*/
static void *thread_manage_apps(void *data)
{
*/
static void *thread_manage_apps(void *data)
{
+ int i, ret, current_nb_fd;
unsigned int nb_fd = 2;
int update_poll_flag = 1;
struct pollfd *pollfd = NULL;
unsigned int nb_fd = 2;
int update_poll_flag = 1;
struct pollfd *pollfd = NULL;
DBG("[thread] Manage application started");
ust_cmd.sock = -1;
DBG("[thread] Manage application started");
ust_cmd.sock = -1;
while (1) {
/* See if we have a valid socket to add to pollfd */
while (1) {
/* See if we have a valid socket to add to pollfd */
/* The pollfd struct must be updated */
if (update_poll_flag) {
/* The pollfd struct must be updated */
if (update_poll_flag) {
- ret = update_apps_cmd_pollfd(nb_fd, ARRAY_SIZE(pollfd), &pollfd);
+ ret = update_apps_cmd_pollfd(nb_fd, current_nb_fd, &pollfd);
if (ret < 0) {
/* malloc failed so we quit */
goto error;
if (ret < 0) {
/* malloc failed so we quit */
goto error;
- count = nb_fd;
- for (i = 2; i < count; i++) {
+ current_nb_fd = nb_fd;
+ for (i = 2; i < current_nb_fd; i++) {
/* Apps socket is closed/hungup */
switch (pollfd[i].revents) {
case POLLERR:
/* Apps socket is closed/hungup */
switch (pollfd[i].revents) {
case POLLERR:
+ if (nb_fd != current_nb_fd) {
update_poll_flag = 1;
}
}
update_poll_flag = 1;
}
}