提交 29a7c2e5 编写于 作者: P Peter Krempa

rpc: ssh: Use virStrToLong_i instead of virParseNumber

Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 5857a635
......@@ -157,6 +157,7 @@ static int
virNetLibsshSessionOnceInit(void)
{
const char *dbgLevelStr;
int dbgLevel;
if (!VIR_CLASS_NEW(virNetLibsshSession, virClassForObjectLockable()))
return -1;
......@@ -172,10 +173,9 @@ virNetLibsshSessionOnceInit(void)
#endif
dbgLevelStr = virGetEnvAllowSUID("LIBVIRT_LIBSSH_DEBUG");
if (dbgLevelStr) {
int dbgLevel = virParseNumber(&dbgLevelStr);
if (dbgLevelStr &&
virStrToLong_i(dbgLevelStr, NULL, 10, &dbgLevel) >= 0)
ssh_set_log_level(dbgLevel);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册