summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/motd.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/motd.c b/src/motd.c
index 889d04e..21218e3 100644
--- a/src/motd.c
+++ b/src/motd.c
@@ -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;
}