ust-app: fix bogus double-use of iterator
[lttng-tools.git] / lttng-sessiond / ust-app.c
index 43832aacba25a56b8b6f90791afd5067b487b59f..a30b01dca37ce7515d183430921e79929d66c391 100644 (file)
@@ -479,8 +479,11 @@ static void shadow_copy_channel(struct ust_app_channel *ua_chan,
 
        /* Copy all events from ltt ust channel to ust app channel */
        cds_lfht_for_each_entry(uchan->events, &iter, uevent, node) {
+               struct cds_lfht_iter uiter;
+
                ua_event_node = hashtable_lookup(ua_chan->events,
-                               (void *) uevent->attr.name, strlen(uevent->attr.name), &iter);
+                               (void *) uevent->attr.name, strlen(uevent->attr.name),
+                               &uiter);
                if (ua_event_node == NULL) {
                        DBG2("UST event %s not found on shadow copy channel",
                                        uevent->attr.name);
@@ -516,8 +519,11 @@ static void shadow_copy_session(struct ust_app_session *ua_sess,
        /* Iterate over all channels in global domain. */
        cds_lfht_for_each_entry(usess->domain_global.channels, &iter,
                        uchan, node) {
+               struct cds_lfht_iter uiter;
+
                ua_chan_node = hashtable_lookup(ua_sess->channels,
-                               (void *)uchan->name, strlen(uchan->name), &iter);
+                               (void *)uchan->name, strlen(uchan->name),
+                               &uiter);
                if (ua_chan_node != NULL) {
                        continue;
                }
@@ -1054,6 +1060,8 @@ int ust_app_create_event_all(struct ltt_ust_session *usess,
 
        /* For all registered applications */
        cds_lfht_for_each_entry(ust_app_ht, &iter, app, node) {
+               struct cds_lfht_iter uiter;
+
                /* Create session on the tracer side and add it to app session HT */
                ua_sess = create_ust_app_session(usess, app);
                if (ua_sess == NULL) {
@@ -1062,7 +1070,8 @@ int ust_app_create_event_all(struct ltt_ust_session *usess,
 
                /* Lookup channel in the ust app session */
                ua_chan_node = hashtable_lookup(ua_sess->channels,
-                               (void *)uchan->name, strlen(uchan->name), &iter);
+                               (void *)uchan->name, strlen(uchan->name),
+                               &uiter);
                if (ua_chan_node == NULL) {
                        ERR("Channel %s not found in session uid %d. Skipping",
                                        uchan->name, usess->uid);
@@ -1141,7 +1150,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
        }
 
        /* Setup UST consumer socket and send fds to it */
-       ret = ust_consumer_send_session(usess->consumer_fd, ua_sess);
+       ret = ust_consumer_send_session(ust_consumer_fd, ua_sess);
        if (ret < 0) {
                goto error_rcu_unlock;
        }
This page took 0.025401 seconds and 4 git commands to generate.