summaryrefslogtreecommitdiff
path: root/src/core/mount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-09 15:20:10 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-09 15:26:11 +0200
commit74ca738f6a01fb5fc19c5c3899f5cb1fdc1d7f68 (patch)
tree920d0abca454976756296d982d1cb9ef794e1ade /src/core/mount.c
parent9c00a6adfa6c2ded071222b2ec76295480add34e (diff)
util: introduce safe_fclose() and port everything over to it
Adds a coccinelle script to port things over automatically.
Diffstat (limited to 'src/core/mount.c')
-rw-r--r--src/core/mount.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 83746ca412..1f02aa5566 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1540,10 +1540,7 @@ static void mount_shutdown(Manager *m) {
m->mount_event_source = sd_event_source_unref(m->mount_event_source);
m->mount_utab_event_source = sd_event_source_unref(m->mount_utab_event_source);
- if (m->proc_self_mountinfo) {
- fclose(m->proc_self_mountinfo);
- m->proc_self_mountinfo = NULL;
- }
+ m->proc_self_mountinfo = safe_fclose(m->proc_self_mountinfo);
m->utab_inotify_fd = safe_close(m->utab_inotify_fd);
}