chiark / gitweb /
selinux: remove anything PID1-specific from selinux-access.[ch] so that we can reuse...
[elogind.git] / src / core / hostname-setup.c
index 25ea09c733d3070e2e5479d43ad499be8a9f24ad..120024065a036551573b00f3d8ca438eedee2fe1 100644 (file)
@@ -67,7 +67,7 @@ static int read_distro_hostname(char **hn) {
 
 #if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
         int r;
-        FILE *f;
+        _cleanup_fclose_ FILE *f = NULL;
 
         assert(hn);
 
@@ -114,7 +114,6 @@ static int read_distro_hostname(char **hn) {
         r = -ENOENT;
 
 finish:
-        fclose(f);
         return r;
 
 #elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)