summaryrefslogtreecommitdiffstats
path: root/sbin/savecore
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-12-21 07:41:07 +0000
committerobrien <obrien@FreeBSD.org>1999-12-21 07:41:07 +0000
commita47dd1c1e2f968781f1a63b42123dcf4397a3a11 (patch)
tree8bf3ea0ec31135ab8bba9036cf3a210e84019b30 /sbin/savecore
parent220d3c3bf11ba5fdff20ba3c811021b14eff84f0 (diff)
downloadFreeBSD-src-a47dd1c1e2f968781f1a63b42123dcf4397a3a11.zip
FreeBSD-src-a47dd1c1e2f968781f1a63b42123dcf4397a3a11.tar.gz
Fix bogus initialization of using a sledge hammer to quite -Wall, bad
indention, and size issue between 32 and 64bit machines. Submitted by: bde
Diffstat (limited to 'sbin/savecore')
-rw-r--r--sbin/savecore/savecore.c9
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)
OpenPOWER on IntegriCloud