swanctl: Don't print status message if nothing was loaded to stderr

This is not an error (as reflected by the returned status code) so we
should not print to stderr as output there might still be considered an
error (or at least an audit-worthy event) by some scripts.
This commit is contained in:
Tobias Brunner 2021-01-27 14:51:56 +01:00
parent 2566eb2194
commit 4dc9edfa55
3 changed files with 4 additions and 3 deletions

View File

@ -292,7 +292,7 @@ int load_authorities_cfg(vici_conn_t *conn, command_format_options_t format,
}
if (found == 0)
{
fprintf(stderr, "no authorities found, %u unloaded\n", unloaded);
printf("no authorities found, %u unloaded\n", unloaded);
return 0;
}
if (loaded == found)
@ -301,6 +301,7 @@ int load_authorities_cfg(vici_conn_t *conn, command_format_options_t format,
loaded, unloaded);
return 0;
}
fprintf(stderr, "loaded %u of %u authorities, %u failed to load, "
"%u unloaded\n", loaded, found, found - loaded, unloaded);
return EINVAL;

View File

@ -410,7 +410,7 @@ int load_conns_cfg(vici_conn_t *conn, command_format_options_t format,
}
if (found == 0)
{
fprintf(stderr, "no connections found, %u unloaded\n", unloaded);
printf("no connections found, %u unloaded\n", unloaded);
return 0;
}
if (loaded == found)

View File

@ -233,7 +233,7 @@ int load_pools_cfg(vici_conn_t *conn, command_format_options_t format,
}
if (found == 0)
{
fprintf(stderr, "no pools found, %u unloaded\n", unloaded);
printf("no pools found, %u unloaded\n", unloaded);
return 0;
}
if (loaded == found)