diff --git a/systemd-sslh-generator.c b/systemd-sslh-generator.c index 1082a43..50ba555 100644 --- a/systemd-sslh-generator.c +++ b/systemd-sslh-generator.c @@ -307,12 +307,12 @@ int main(int argc, char *argv[]) { err_log = stderr; } const int r = gen_sslh_config(systemd_invoked ? argv[1] : ""); - if (systemd_invoked) { - fclose(err_log); - } if (!r) { fprintf(err_log, "systemd-sslh-generator: Successfully generated all targets.\n"); } + if (systemd_invoked) { + fclose(err_log); + } return r < 0 ? -1 : 0; } else { printf("This program takes three or no arguments.\n");