diff options
author | obrien <obrien@FreeBSD.org> | 1999-12-08 06:22:58 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-12-08 06:22:58 +0000 |
commit | 206faac867ad613df4fefc667808cf7adf497c5d (patch) | |
tree | feb086d464fba542a4162ad0d5c4db82f36d9b3c /sbin/savecore/savecore.c | |
parent | 0fef0f17e23dfa33bd2e5806f5dd13042e4ff353 (diff) | |
download | FreeBSD-src-206faac867ad613df4fefc667808cf7adf497c5d.zip FreeBSD-src-206faac867ad613df4fefc667808cf7adf497c5d.tar.gz |
When erroring out that there is not enough space to write the corefile,
tell the user how much space is avaible for writing the corefile, and how
much space we wanted.
Diffstat (limited to 'sbin/savecore/savecore.c')
-rw-r--r-- | sbin/savecore/savecore.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 4569fe8..ddaf23a 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -286,7 +286,6 @@ kmem_setup() void check_kmem() { - register char *cp; char core_vers[1024], *p; DumpRead(dumpfd, core_vers, sizeof(core_vers), @@ -344,6 +343,8 @@ 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. @@ -510,7 +511,7 @@ rawname(s) "can't make raw dump device name from %s", s); return (s); } - (void)snprintf(name, sizeof(name), "%.*s/r%s", sl - s, s, sl + 1); + (void)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); @@ -586,7 +587,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"); + "no dump, not enough free space on device (%ld available, need %ld", + (minfree > 0) ? spacefree : totfree, needed); return (0); } if (spacefree - needed < 0) |