X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fhostname-setup.c;h=fd111a65a4516bf170973cb01245298759913cdd;hp=e3ea5fe767f8a8440f0a895087622d153510ea2c;hb=0eb59ccfe619cbc4b42ef8ff02b52971994dfe05;hpb=344de60901f0e3ce0d2f112b7be97fc6d0e2f071 diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c index e3ea5fe76..fd111a65a 100644 --- a/src/core/hostname-setup.c +++ b/src/core/hostname-setup.c @@ -30,7 +30,7 @@ #include "util.h" #include "log.h" -#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO) || defined(TARGET_MAGEIA) +#if defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA) #define FILENAME "/etc/sysconfig/network" #elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE) #define FILENAME "/etc/HOSTNAME" @@ -65,9 +65,9 @@ static int read_and_strip_hostname(const char *path, char **hn) { 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_MEEGO) || defined(TARGET_MAGEIA) +#if 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)