PREFIX = /usr/local
MANPREFIX = ${PREFIX}/man
+# compiler and linker
+#CC = cc
+
GITINC = /usr/local/include
GITLIB = /usr/local/lib
#CFLAGS = -static -O2 -std=c99 ${INCS}
#LDFLAGS = -static -s ${LIBS}
-CPPFLAGS= -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE ${INCS}
-# compiler and linker
-#CC = cc
+CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE ${INCS}
+
+# OpenBSD 5.9+: use pledge(2)
+#CPPFLAGS += -DUSE_PLEDGE
static char *name = "";
static char owner[255];
+#ifndef USE_PLEDGE
+int
+pledge(const char *promises, const char *paths[])
+{
+ return 0;
+}
+#endif
+
/* Escape characters below as HTML 2.0 / XML 1.0. */
void
xmlencode(FILE *fp, const char *s, size_t len)
char path[PATH_MAX], repodirabs[PATH_MAX + 1];
int i, ret = 0;
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
+
if (argc < 2) {
fprintf(stderr, "%s [repodir...]\n", argv[0]);
return 1;
static FILE *rcachefp, *wcachefp;
static const char *cachefile;
+#ifndef USE_PLEDGE
+int
+pledge(const char *promises, const char *paths[])
+{
+ return 0;
+}
+#endif
+
void
deltainfo_free(struct deltainfo *di)
{
size_t n;
int i, fd;
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
+
for (i = 1; i < argc; i++) {
if (argv[i][0] != '-') {
if (repodir)