diff options
-rw-r--r-- | sbin/savecore/savecore.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index ddaf23a..6bac5e7 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -343,8 +343,6 @@ save_core() char *rawp, path[MAXPATHLEN]; mode_t oumask; - bounds = ifd = nr = nw = ofd = 0; - /* * Get the current number and update the bounds file. Do the update * now, because may fail later and don't want to overwrite anything. @@ -376,6 +374,7 @@ err1: syslog(LOG_WARNING, "%s: %s", path, strerror(errno)); syslog(LOG_ERR, "%s: %s", path, strerror(errno)); exit(1); } + ofd = -1; /* Not actually used. */ } else ofd = Create(path, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); (void)umask(oumask); @@ -511,7 +510,7 @@ rawname(s) "can't make raw dump device name from %s", s); return (s); } - (void)snprintf(name, sizeof(name), "%.*s/r%s", (int)(sl - s), s, sl + 1); + snprintf(name, sizeof(name), "%.*s/r%s", (int)(sl - s), s, sl + 1); if ((sl = strdup(name)) == NULL) { syslog(LOG_ERR, "%s", strerror(errno)); exit(1); @@ -587,8 +586,8 @@ check_space() needed = (dumpsize + kernelsize) / 1024; if (((minfree > 0) ? spacefree : totfree) - needed < minfree) { syslog(LOG_WARNING, - "no dump, not enough free space on device (%ld available, need %ld", - (minfree > 0) ? spacefree : totfree, needed); + "no dump, not enough free space on device (%lld available, need %lld)", + (long long)(minfree > 0 ? spacefree : totfree), (long long)needed); return (0); } if (spacefree - needed < 0) |