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.
This commit is contained in:
David E. O'Brien 1999-12-08 06:22:58 +00:00
parent 8d29af8945
commit 3eb8166fc0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54283

View File

@ -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)