linked_list_t *list;
};
-static bool collect_tags(private_swid_inventory_t *this, char *pathname)
+static bool collect_tags(private_swid_inventory_t *this, char *pathname,
+ int *tag_count)
{
char *rel_name, *abs_name;
struct stat st;
}
if (S_ISDIR(st.st_mode))
{
- if (!collect_tags(this, abs_name))
+ if (!collect_tags(this, abs_name, tag_count))
{
goto end;
}
tag_id = swid_tag_id_create(tag_creator, unique_sw_id, unique_seq_id);
this->list->insert_last(this->list, tag_id);
}
+ (*tag_count)++;
+
}
success = TRUE;
METHOD(swid_inventory_t, collect, bool,
private_swid_inventory_t *this)
{
- return collect_tags(this, SWID_TAG_DIRECTORY);
+ int tag_count = 0;
+
+ if (collect_tags(this, SWID_TAG_DIRECTORY, &tag_count))
+ {
+ DBG1(DBG_IMC, "collected %d SWID tag%s%s", tag_count,
+ this->full_tags ? "" : " ID", (tag_count == 1) ? "" : "s");
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
}
METHOD(swid_inventory_t, add, void,