#LDFLAGS = -static -s ${LIBS}
CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE ${INCS}
-
-# OpenBSD 5.9+: use pledge(2)
-#CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE -DUSE_PLEDGE ${INCS}
static char *name = "";
static char owner[255];
-#ifndef USE_PLEDGE
-#define pledge(p1,p2) 0
-#endif
-
void
joinpath(char *buf, size_t bufsiz, const char *path, const char *path2)
{
git_libgit2_init();
+#ifdef __OpenBSD__
if (pledge("stdio rpath", NULL) == -1)
err(1, "pledge");
+#endif
writeheader(stdout);
static FILE *rcachefp, *wcachefp;
static const char *cachefile;
-#ifndef USE_PLEDGE
-#define pledge(p1,p2) 0
-#endif
-
void
joinpath(char *buf, size_t bufsiz, const char *path, const char *path2)
{
git_libgit2_init();
+#ifdef __OpenBSD__
if (cachefile) {
if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
err(1, "pledge");
if (pledge("stdio rpath wpath cpath", NULL) == -1)
err(1, "pledge");
}
+#endif
if (git_repository_open_ext(&repo, repodir,
GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) {