1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Revert part of revision 1.74 after bde reminded me of a detail I'd

forgotten about how sysctl works.  This removes a potential (though
not very likely) race that 1.74 introduced.
This commit is contained in:
Dag-Erling Smørgrav 2003-12-11 07:46:08 +00:00
parent 165d50f626
commit 56f9b09632
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123438

View File

@ -852,10 +852,13 @@ dointr(void)
kread(X_INTRCNT, intrcnt, intrcntlen);
kread(X_INTRNAMES, intrname, inamlen);
} else {
mysysctl("hw.intrcnt", NULL, &intrcntlen, NULL, 0);
if ((intrcnt = malloc(intrcntlen)) == NULL)
err(1, "calloc()");
mysysctl("hw.intrcnt", intrcnt, &intrcntlen, NULL, 0);
for (intrcnt = NULL, intrcntlen = 1024; ; intrcntlen *= 2) {
if ((intrcnt = reallocf(intrcnt, intrcntlen)) == NULL)
err(1, "reallocf()");
if (mysysctl("hw.intrcnt",
intrcnt, &intrcntlen, NULL, 0) == 0)
break;
}
for (intrname = NULL, inamlen = 1024; ; inamlen *= 2) {
if ((intrname = reallocf(intrname, inamlen)) == NULL)
err(1, "reallocf()");