From 7c815b0db8f73c7659ab0e83721df63a0b191d6e Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Tue, 21 Dec 1999 07:41:07 +0000 Subject: [PATCH] Fix bogus initialization of using a sledge hammer to quite -Wall, bad indention, and size issue between 32 and 64bit machines. Submitted by: bde --- sbin/savecore/savecore.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index ddaf23a36c33..6bac5e719d32 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)