1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

core: use safe_fclose() where we can

This commit is contained in:
Lennart Poettering 2017-11-28 21:24:20 +01:00
parent 7d7a99ac9f
commit 50fb00b707

View File

@ -571,8 +571,7 @@ void unit_free(Unit *u) {
if (!u)
return;
if (u->transient_file)
fclose(u->transient_file);
u->transient_file = safe_fclose(u->transient_file);
if (!MANAGER_IS_RELOADING(u->manager))
unit_remove_transient(u);
@ -1505,9 +1504,7 @@ int unit_load(Unit *u) {
if (r < 0)
goto fail;
fclose(u->transient_file);
u->transient_file = NULL;
u->transient_file = safe_fclose(u->transient_file);
u->fragment_mtime = now(CLOCK_REALTIME);
}