summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-30 02:46:34 +0000
committerJune McEnroe <june@causal.agency>2021-09-30 02:46:34 +0000
commit3f9a828c38a72218e42504ddb9b398331ddce3d8 (patch)
tree9e3ae77454d4f367860ea6d4cab3a839538c7f21
parentpledge(2) htagml (diff)
downloadsrc-3f9a828c38a72218e42504ddb9b398331ddce3d8.tar.gz
src-3f9a828c38a72218e42504ddb9b398331ddce3d8.zip
pledge(2) mtags
-rw-r--r--bin/mtags.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/mtags.c b/bin/mtags.c
index 1ebfbac5..11cd9c8a 100644
--- a/bin/mtags.c
+++ b/bin/mtags.c
@@ -34,6 +34,7 @@ static void escape(FILE *file, const char *str, size_t len) {
 }
 
 int main(int argc, char *argv[]) {
+	int error;
 	bool append = false;
 	const char *path = "tags";
 	for (int opt; 0 < (opt = getopt(argc, argv, "af:"));) {
@@ -47,10 +48,15 @@ int main(int argc, char *argv[]) {
 	FILE *tags = fopen(path, (append ? "a" : "w"));
 	if (!tags) err(EX_CANTCREAT, "%s", path);
 
+#ifdef __OpenBSD__
+	error = pledge("stdio rpath", NULL);
+	if (error) err(EX_OSERR, "pledge");
+#endif
+
 	regex_t makeFile, makeLine;
 	regex_t mdocFile, mdocLine;
 	regex_t shFile, shLine;
-	int error = 0
+	error = 0
 		|| regcomp(&makeFile, "(^|/)Makefile|[.]mk$", REG_EXTENDED | REG_NOSUB)
 		|| regcomp(
 			&makeLine,