Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
libpkg: Use line buffering for the metalog file handle
Mark Johnston committed 6 months ago
commit 7ea9566835a82f111d7771f58168babc5e0dde6a
parent 3530a07
1 file changed +4 -4
modified libpkg/metalog.c
@@ -37,11 +37,11 @@ int
metalog_open(const char *metalog)
{
	metalogfp = fopen(metalog, "ae");
-
	if (metalogfp == NULL) {
+
	if (metalogfp == NULL)
		pkg_fatal_errno("Unable to open metalog '%s'", metalog);
-
	} 
-

-
	return EPKG_OK;
+
	/* Package install scripts may add entries, so avoid interleaving. */
+
	setvbuf(metalogfp, NULL, _IOLBF, 0);
+
	return (EPKG_OK);
}

int