mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
rpc: ssh: Use virStrToLong_i instead of virParseNumber
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
5857a63519
commit
29a7c2e5d8
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user