I'm not sure what changed to cause this, but using 'dirname' as a variable

was colliding with dirname() in libc.a and causing a Sig 10/bus error.
Just change dirname to savedir and be done with it.
This commit is contained in:
peter 2000-09-03 07:02:00 +00:00
parent 804bda0e68
commit 1c39180518

View File

@ -108,7 +108,7 @@ int dumpmag; /* magic number in dump */
int dumpsize; /* amount of memory dumped */
char *kernel;
char *dirname; /* directory to save dumps in */
char *savedir; /* directory to save dumps in */
char *ddname; /* name of dump device */
dev_t dumpdev; /* dump device */
int dumpfd; /* read/write descriptor on char dev */
@ -175,7 +175,7 @@ main(argc, argv)
if (!clear) {
if (argc != 1 && argc != 2)
usage();
dirname = argv[0];
savedir = argv[0];
}
if (argc == 2)
kernel = argv[1];
@ -348,7 +348,7 @@ save_core()
* Get the current number and update the bounds file. Do the update
* now, because may fail later and don't want to overwrite anything.
*/
(void)snprintf(path, sizeof(path), "%s/bounds", dirname);
(void)snprintf(path, sizeof(path), "%s/bounds", savedir);
if ((fp = fopen(path, "r")) == NULL)
goto err1;
if (fgets(buf, sizeof(buf), fp) == NULL) {
@ -369,7 +369,7 @@ err1: syslog(LOG_WARNING, "%s: %s", path, strerror(errno));
/* Create the core file. */
oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file.*/
(void)snprintf(path, sizeof(path), "%s/vmcore.%d%s",
dirname, bounds, compress ? ".Z" : "");
savedir, bounds, compress ? ".Z" : "");
if (compress) {
if ((fp = zopen(path, "w", 0)) == NULL) {
syslog(LOG_ERR, "%s: %s", path, strerror(errno));
@ -420,7 +420,7 @@ err2: syslog(LOG_WARNING,
/* Copy the kernel. */
ifd = Open(kernel ? kernel : getbootfile(), O_RDONLY);
(void)snprintf(path, sizeof(path), "%s/kernel.%d%s",
dirname, bounds, compress ? ".Z" : "");
savedir, bounds, compress ? ".Z" : "");
if (compress) {
if ((fp = zopen(path, "w", 0)) == NULL) {
syslog(LOG_ERR, "%s: %s", path, strerror(errno));
@ -541,14 +541,14 @@ check_space()
}
kernelsize = st.st_blocks * S_BLKSIZE;
if (statfs(dirname, &fsbuf) < 0) {
syslog(LOG_ERR, "%s: %m", dirname);
if (statfs(savedir, &fsbuf) < 0) {
syslog(LOG_ERR, "%s: %m", savedir);
exit(1);
}
spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024;
totfree = ((off_t) fsbuf.f_bfree * fsbuf.f_bsize) / 1024;
(void)snprintf(path, sizeof(path), "%s/minfree", dirname);
(void)snprintf(path, sizeof(path), "%s/minfree", savedir);
if ((fp = fopen(path, "r")) == NULL)
minfree = 0;
else {