mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
remote: remove unnecessary return value and if branch
Function daemonConfigFilePath() will assign a path to remote_config_file definitely and the path will be validated in following codes. So, it's unnecessary to return value from daemonConfigFilePath() and check the returned value. Signed-off-by: jiangjiacheng <jiangjiacheng@huawei.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
This commit is contained in:
parent
51f8130d78
commit
381c8dbde0
@ -903,11 +903,7 @@ int main(int argc, char **argv) {
|
||||
/* No explicit config, so try and find a default one */
|
||||
if (remote_config_file == NULL) {
|
||||
implicit_conf = true;
|
||||
if (daemonConfigFilePath(privileged,
|
||||
&remote_config_file) < 0) {
|
||||
VIR_ERROR(_("Can't determine config path"));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
daemonConfigFilePath(privileged, &remote_config_file);
|
||||
}
|
||||
|
||||
/* Read the config file if it exists */
|
||||
|
@ -72,7 +72,7 @@ remoteConfigGetAuth(virConf *conf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
void
|
||||
daemonConfigFilePath(bool privileged, char **configfile)
|
||||
{
|
||||
if (privileged) {
|
||||
@ -84,8 +84,6 @@ daemonConfigFilePath(bool privileged, char **configfile)
|
||||
|
||||
*configfile = g_strdup_printf("%s/%s.conf", configdir, DAEMON_NAME);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct daemonConfig*
|
||||
|
@ -99,7 +99,7 @@ struct daemonConfig {
|
||||
};
|
||||
|
||||
|
||||
int daemonConfigFilePath(bool privileged, char **configfile);
|
||||
void daemonConfigFilePath(bool privileged, char **configfile);
|
||||
struct daemonConfig* daemonConfigNew(bool privileged);
|
||||
void daemonConfigFree(struct daemonConfig *data);
|
||||
int daemonConfigLoadFile(struct daemonConfig *data,
|
||||
|
Loading…
Reference in New Issue
Block a user