www/cgit/patches/patch-setup_c (view raw)
1$OpenBSD: patch-setup_c,v 1.1 2017/03/22 20:23:52 landry Exp $
2
3Dont openbsd dev/null, doesnt exist in the default chroot
4
5--- git/setup.c.orig Wed Mar 1 21:01:06 2017
6+++ git/setup.c Wed Mar 1 21:01:56 2017
7@@ -1024,6 +1024,7 @@ const char *resolve_gitdir(const char *suspect)
8 /* if any standard file descriptor is missing open it to /dev/null */
9 void sanitize_stdfds(void)
10 {
11+#if 0
12 int fd = open("/dev/null", O_RDWR, 0);
13 while (fd != -1 && fd < 2)
14 fd = dup(fd);
15@@ -1031,6 +1032,7 @@ void sanitize_stdfds(void)
16 die_errno("open /dev/null or dup failed");
17 if (fd > 2)
18 close(fd);
19+#endif
20 }
21
22 int daemonize(void)