Fixed style bugs in rev.1.5:

- missing whitespace
- strange version of warn() built out of warnx() + strerror().  Just use
  warn().
- conversion of just one of the two perror()'s to warn*()

Actually use _warn() instead of _warn(), to keep up with namespace-
unpollution for warn().
This commit is contained in:
Bruce Evans 2002-02-15 02:28:50 +00:00
parent a6959af6b1
commit 2c316efdf3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90667

View File

@ -43,8 +43,9 @@ __FBSDID("$FreeBSD$");
#include <sys/gmon.h>
#include <sys/sysctl.h>
#include "namespace.h"
#include <err.h>
#include <errno.h>
#include "un-namespace.h"
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
@ -174,16 +175,16 @@ _mcleanup()
}
moncontrol(0);
snprintf(outname,sizeof(outname),"%s.gmon",__progname);
snprintf(outname, sizeof(outname), "%s.gmon", __progname);
fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY, 0666);
if (fd < 0) {
warnx("_mcleanup: %s - %s",outname,strerror(errno));
_warn("_mcleanup: %s", outname);
return;
}
#ifdef DEBUG
log = _open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY, 0664);
if (log < 0) {
perror("_mcleanup: gmon.log");
_warn("_mcleanup: gmon.log");
return;
}
len = sprintf(buf, "[mcleanup1] kcount 0x%x ssiz %d\n",