stagit

git site generator
Contents

pledge after git_libgit2_init

this is because libgit uses curl which uses some initialization
checks, namely an IPv6 check which creates a socket.

Hiltjo Posthuma hiltjo@codemadness.org

commit: 79babec parent: 7013a46
1 files changed, 8 insertions(+), 5 deletions(-)
Mstagit.c+8-5
M · stagit.c +8, -5
 1@@ -1027,9 +1027,6 @@ main(int argc, char *argv[])
 2 size_t n;
 3 int i, fd;
 4
 5- if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
 6- err(1,
"pledge");
 7-
 8 for (i = 1; i < argc; i++) {
 9 if (argv[i][0] !=
'-') {
10 if (repodir)
11@@ -1052,8 +1049,6 @@ main(int argc, char *argv[])
12 usage(argv[0]);
13 }
14 }
15- if (!cachefile && pledge("stdio rpath wpath cpath", NULL) == -1)
16- err(1,
"pledge");
17 if (!repodir)
18 usage(argv[0]);
19
20@@ -1062,6 +1057,14 @@ main(int argc, char *argv[])
21
22
git_libgit2_init();
23
24+ if (cachefile) {
25+ if
(pledge("stdio rpath wpath cpath fattr", NULL) == -1)
26+ err(1,
"pledge");
27+ } else {
28+ if
(pledge("stdio rpath wpath cpath", NULL) == -1)
29+ err(1,
"pledge");
30+ }
31+
32 if (git_repository_open_ext(&repo, repodir,
33
GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) {
34 e =
giterr_last();