certctl: Fix bootstrap build

Fixes:		81d8827ad8 ("certctl: Reimplement in C")
This commit is contained in:
Dag-Erling Smørgrav
2025-08-14 00:38:52 +02:00
parent 2f8bbfe587
commit c989e3cc3d
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -7,4 +7,8 @@ LIBADD= crypto
HAS_TESTS=
SUBDIR.${MK_TESTS}= tests
.ifdef BOOTSTRAPPING
CFLAGS+=-DBOOTSTRAPPING
.endif
.include <bsd.prog.mk>
+6 -1
View File
@@ -387,7 +387,12 @@ write_certs(const char *dir, struct cert_tree *tree)
* Open and scan the directory.
*/
if ((d = open(dir, O_DIRECTORY | O_RDONLY)) < 0 ||
(ndents = fdscandir(d, &dents, NULL, lexisort)) < 0)
#ifdef BOOTSTRAPPING
(ndents = scandir(dir, &dents, NULL, lexisort))
#else
(ndents = fdscandir(d, &dents, NULL, lexisort))
#endif
< 0)
err(1, "%s", dir);
/*
* Iterate over the directory listing and the certificate listing