Skip to content

Commit

Permalink
Resolving issue with device 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cigamit committed Aug 25, 2019
1 parent 4a2d1ae commit d6e76c2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spine.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,12 @@ int main(int argc, char *argv[]) {
qp += sprintf(qp, " ORDER BY polling_time DESC");

result = db_query(&mysql, LOCAL, querybuf);
num_rows = mysql_num_rows(result); /* pollerid 0 takes care of not host based data sources */

if (set.poller_id == 1) {
num_rows = mysql_num_rows(result) + 1; /* pollerid 1 takes care of not host based data sources */
} else {
num_rows = mysql_num_rows(result);
}

if (!(threads = (pthread_t *)malloc(num_rows * sizeof(pthread_t)))) {
die("ERROR: Fatal malloc error: spine.c threads!");
Expand Down Expand Up @@ -657,7 +662,7 @@ int main(int argc, char *argv[]) {
current_thread = 0;

/* poller 0 always polls host 0 */
if (set.poller_id == 0) {
if (set.poller_id == 1) {

This comment has been minimized.

Copy link
@netniV

netniV Aug 26, 2019

Member

Only a minor thing but the comment is incorrect on this as it differs from the code.

host_id = 0;
change_host = FALSE;
} else {
Expand Down

0 comments on commit d6e76c2

Please sign in to comment.