28 lines
663 B
Text
28 lines
663 B
Text
|
add pledge(2) to "mutool poster"
|
||
|
|
||
|
Index: source/tools/pdfposter.c
|
||
|
--- source/tools/pdfposter.c.orig
|
||
|
+++ source/tools/pdfposter.c
|
||
|
@@ -27,6 +27,8 @@
|
||
|
#include "mupdf/fitz.h"
|
||
|
#include "mupdf/pdf.h"
|
||
|
|
||
|
+#include <unistd.h>
|
||
|
+#include <errno.h>
|
||
|
#include <string.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
@@ -226,6 +228,12 @@ int pdfposter_main(int argc, char **argv)
|
||
|
(strstr(argv[fz_optind], ".pdf") || strstr(argv[fz_optind], ".PDF")))
|
||
|
{
|
||
|
outfile = argv[fz_optind++];
|
||
|
+ }
|
||
|
+
|
||
|
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
|
||
|
+ {
|
||
|
+ fprintf(stderr, "pledge: %s\n", strerror(errno));
|
||
|
+ exit(1);
|
||
|
}
|
||
|
|
||
|
ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);
|