diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/motd.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -126,18 +126,19 @@ motd_cache(struct Motd *motd) } } - /* gotta read in the file, now */ - if ((file = fopen(motd->path, "r")) == NULL) + /* need the file's modification time */ + if (stat(motd->path, &sb) == -1) { - ilog(LOG_TYPE_IRCD, "Couldn't open \"%s\": %s", motd->path, + ilog(LOG_TYPE_IRCD, "Couldn't stat \"%s\": %s", motd->path, strerror(errno)); return 0; } - /* need the file's modification time */ - if (stat(motd->path, &sb) == -1) + /* gotta read in the file, now */ + if ((file = fopen(motd->path, "r")) == NULL) { - fclose(file); + ilog(LOG_TYPE_IRCD, "Couldn't open \"%s\": %s", motd->path, + strerror(errno)); return 0; } |