projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d7a99a
)
core: use safe_fclose() where we can
author
Lennart Poettering
<lennart@poettering.net>
Tue, 28 Nov 2017 20:24:20 +0000
(21:24 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 29 Nov 2017 11:34:12 +0000
(12:34 +0100)
src/core/unit.c
patch
|
blob
|
history
diff --git
a/src/core/unit.c
b/src/core/unit.c
index a12d24b90b853b0b7ad78ee342c40e17857873cf..1bbe5fdded1f41396f5bca0eb569cbaffa984dad 100644
(file)
--- a/
src/core/unit.c
+++ b/
src/core/unit.c
@@
-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);
}