summaryrefslogtreecommitdiff
path: root/stagit.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-05-25 18:43:36 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-05-25 18:43:36 +0200
commit187daac42007c87e6af9317a20446e3b81907f63 (patch)
tree9fa7eac70a4888d32c96b42c1195095aab7b908f /stagit.c
parentc7f158c58c338961b1a1a91f41a5dade42853dec (diff)
assume OpenBSD 5.9+, always try pledge(2) on OpenBSD
Diffstat (limited to 'stagit.c')
-rw-r--r--stagit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/stagit.c b/stagit.c
index 06c213c..86c3920 100644
--- a/stagit.c
+++ b/stagit.c
@@ -65,10 +65,6 @@ static char lastoidstr[GIT_OID_HEXSZ + 2]; /* id + newline + nul byte */
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)
{
@@ -1057,6 +1053,7 @@ main(int argc, char *argv[])
git_libgit2_init();
+#ifdef __OpenBSD__
if (cachefile) {
if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
err(1, "pledge");
@@ -1064,6 +1061,7 @@ main(int argc, char *argv[])
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) {