mirror of
https://github.com/systemd/systemd.git
synced 2025-01-27 18:04:05 +03:00
core: use safe_fclose() where we can
This commit is contained in:
parent
7d7a99ac9f
commit
50fb00b707
@ -571,8 +571,7 @@ void unit_free(Unit *u) {
|
|||||||
if (!u)
|
if (!u)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (u->transient_file)
|
u->transient_file = safe_fclose(u->transient_file);
|
||||||
fclose(u->transient_file);
|
|
||||||
|
|
||||||
if (!MANAGER_IS_RELOADING(u->manager))
|
if (!MANAGER_IS_RELOADING(u->manager))
|
||||||
unit_remove_transient(u);
|
unit_remove_transient(u);
|
||||||
@ -1505,9 +1504,7 @@ int unit_load(Unit *u) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
fclose(u->transient_file);
|
u->transient_file = safe_fclose(u->transient_file);
|
||||||
u->transient_file = NULL;
|
|
||||||
|
|
||||||
u->fragment_mtime = now(CLOCK_REALTIME);
|
u->fragment_mtime = now(CLOCK_REALTIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user