提交 964482ae 编写于 作者: F Fabiano Fidêncio

rpc: Don't check the output of virGetUserConfigDirectory()

virGetUserConfigDirectory() *never* *ever* returns NULL, making the
checks for it completely unnecessary.
Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 2db0583c
......@@ -455,11 +455,9 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host,
knownhosts = g_strdup(knownHostsPath);
} else {
confdir = virGetUserConfigDirectory();
if (confdir) {
virBufferAsprintf(&buf, "%s/known_hosts", confdir);
if (!(knownhosts = virBufferContentAndReset(&buf)))
goto no_memory;
}
virBufferAsprintf(&buf, "%s/known_hosts", confdir);
if (!(knownhosts = virBufferContentAndReset(&buf)))
goto no_memory;
}
if (privkeyPath) {
......@@ -556,8 +554,7 @@ virNetClientPtr virNetClientNewLibssh(const char *host,
knownhosts = g_strdup(knownHostsPath);
} else {
confdir = virGetUserConfigDirectory();
if (confdir)
knownhosts = g_strdup_printf("%s/known_hosts", confdir);
knownhosts = g_strdup_printf("%s/known_hosts", confdir);
}
if (privkeyPath) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册