diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-05-03 00:33:56 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-05-03 00:33:56 +0200 |
commit | aa36e0c9b4d8da06c5dc03a461f9d3fe69a1e7fb (patch) | |
tree | 5f0c8af726df1cbd425e4d33c77aa9410328196a /stagit-index.c | |
parent | eae9437f944f04619cbda9ce7eb460f6ff0d7f4c (diff) |
add OpenBSD pledge(2) support using -DUSE_PLEDGE
Diffstat (limited to 'stagit-index.c')
-rw-r--r-- | stagit-index.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/stagit-index.c b/stagit-index.c index 1d26e0f..afd8320 100644 --- a/stagit-index.c +++ b/stagit-index.c @@ -23,6 +23,14 @@ static char description[255] = "Repositories"; 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) @@ -154,6 +162,9 @@ main(int argc, char *argv[]) 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; |