From 3eb8166fc005b274f5f067105880c147e303e7af Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 8 Dec 1999 06:22:58 +0000 Subject: [PATCH] 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. --- sbin/savecore/savecore.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 4569fe83b7a5..ddaf23a36c33 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)