代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libosinfo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3e61b6ccfc2dcb88cc155b7ca33cbe34f20a25b9 Mon Sep 17 00:00:00 2001
From: huangkaibin <huangkaibin@huawei.com>
Date: Fri, 20 Jul 2018 15:54:54 +0800
Subject: [PATCH] libosinfo: Do not raise error on unknown osinfo db directory.
When an osinfo directory can not be acccessed by the running user,
g_file_query_info will return a type of G_FILE_TYPE_UNKNOWN, and
osinfo_loader_find_files will raise an error and abort the application.
This patch fix this problem by just ignoring this unknown osinfo directory.
---
osinfo/osinfo_loader.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 46bc633..4c30e6c 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -35,6 +35,7 @@
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xmlreader.h>
+#include <errno.h>
#include "ignore-value.h"
#include "osinfo_install_script_private.h"
#include "osinfo_device_driver_private.h"
@@ -2061,8 +2062,14 @@
}
g_object_unref(ents);
g_list_free(children);
+ } else if (type == G_FILE_TYPE_UNKNOWN) {
+ g_warning("File type unknown. path: %s, errno:%d.", g_file_get_path(file), errno);
} else {
- OSINFO_ERROR(&error, "Unexpected file type");
+ char *error_msg;
+ error_msg = g_strdup_printf("Unexpected file type. type: %d, path: %s, errno:%d.",
+ type, g_file_get_path(file), errno);
+ OSINFO_ERROR(&error, error_msg);
+ free(error_msg);
g_propagate_error(err, error);
}
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。