[Libosinfo] [libosinfo PATCH 1/3] db: Set the os to the detected tree

Fabiano Fidêncio fidencio at redhat.com
Fri Apr 12 08:19:52 UTC 2019


When detecting a tree, let's also its OS.

https://gitlab.com/libosinfo/libosinfo/issues/25

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 osinfo/osinfo_db.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
index 1089644..b7da2b7 100644
--- a/osinfo/osinfo_db.c
+++ b/osinfo/osinfo_db.c
@@ -829,8 +829,10 @@ static gboolean compare_tree(OsinfoTree *tree,
         g_list_free(trees);
         g_object_unref(tree_list);
 
-        if (*ret_os != NULL)
+        if (*ret_os != NULL) {
+            osinfo_tree_set_os(*matched, *ret_os);
             return TRUE;
+        }
     }
 
     return FALSE;
-- 
2.20.1




More information about the Libosinfo mailing list