Hi ports@,

This adds a patch to the 2048 port to pledge the game.

Index: patches/patch-pledge
===================================================================
RCS file: patches/patch-pledge
diff -N patches/patch-pledge
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-pledge        22 Sep 2018 17:25:16 -0000
@@ -0,0 +1,26 @@
+
+Pledges 2048
+
+Index: src/main.c
+--- src/main.c.orig
++++ src/main.c
+@@ -1,5 +1,6 @@
+ #include <stdio.h>
+ #include <stdbool.h>
++#include <unistd.h>
+ #include "ai.h"
+ #include "engine.h"
+ #include "gfx.h"
+@@ -13,5 +14,10 @@ void draw_then_sleep(struct gfx_state *s, struct gamestate 
*g)
+
+ int main(int argc, char **argv)
+ {
++    if (pledge("stdio cpath rpath wpath tty", NULL) == -1) {
++      perror("pledge");
++      return 1;
++    }
++
+     struct gamestate *g = gamestate_init(argc, argv);
+     struct gfx_state *s = NULL;
+
+PROGRAM := 2048

Reply via email to