diff options
Diffstat (limited to 'sbin/savecore/savecore.c')
-rw-r--r-- | sbin/savecore/savecore.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 0f1d41e..7a5fc4c 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); } |