mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +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)
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user