aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2014-09-17 19:09:58 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2014-09-17 19:09:58 +0000
commit5e93a4b46be72a40da3b46f50b698bb6b977527f (patch)
tree60dcbd54909d2a8b5d27d7b69c2269a3e207fa89
parentf382031d34cdcbaaa9a5f2fd17296574095b85ad (diff)
Notes
-rw-r--r--sbin/savecore/savecore.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c
index 0f1d41ea83c1..7a5fc4c937da 100644
--- a/sbin/savecore/savecore.c
+++ b/sbin/savecore/savecore.c
@@ -151,7 +151,10 @@ getbounds(void) {
}
if (fgets(buf, sizeof buf, fp) == NULL) {
- syslog(LOG_WARNING, "unable to read from bounds, using 0");
+ if (feof(fp))
+ syslog(LOG_WARNING, "bounds file is empty, using 0");
+ else
+ syslog(LOG_WARNING, "bounds file: %s", strerror(errno));
fclose(fp);
return (ret);
}
@@ -160,6 +163,7 @@ getbounds(void) {
ret = (int)strtol(buf, NULL, 10);
if (ret == 0 && (errno == EINVAL || errno == ERANGE))
syslog(LOG_WARNING, "invalid value found in bounds, using 0");
+ fclose(fp);
return (ret);
}