mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
25 lines
600 B
Plaintext
25 lines
600 B
Plaintext
Simple software acting as an stdio filter, no third party libraries,
|
|
not big churn, so this is a good candidate for pledge.
|
|
|
|
Index: src/main.c
|
|
--- src/main.c.orig
|
|
+++ src/main.c
|
|
@@ -1,3 +1,4 @@
|
|
+#include <unistd.h>
|
|
#define _XOPEN_SOURCE 600
|
|
#include <assert.h>
|
|
#include <ctype.h>
|
|
@@ -777,6 +778,12 @@ int main(int argc, char **argv) {
|
|
fprintf(stderr, "Usage: scdoc < input.scd > output.roff\n");
|
|
return 1;
|
|
}
|
|
+
|
|
+ if (pledge("stdio", NULL) == -1) {
|
|
+ fprintf(stderr, "pledge: %s", strerror(errno));
|
|
+ exit(EXIT_FAILURE);
|
|
+ }
|
|
+
|
|
struct parser p = {
|
|
.input = stdin,
|
|
.output = stdout,
|