ports/textproc/mupdf/patches/patch-source_tools_mudraw_c

27 lines
554 B
Text

add pledge(2) to "mutool draw"
Index: source/tools/mudraw.c
--- source/tools/mudraw.c.orig
+++ source/tools/mudraw.c
@@ -34,6 +34,8 @@
#include "mupdf/helpers/mu-threads.h"
#endif
+#include <errno.h>
+#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
@@ -2145,6 +2147,12 @@ int mudraw_main(int argc, char **argv)
if (fz_optind == argc)
return usage();
+
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ {
+ fprintf(stderr, "pledge: %s\n", strerror(errno));
+ exit(1);
+ }
if (num_workers > 0)
{