aboutsummaryrefslogtreecommitdiff
path: root/mail/exim/patches/200-fix-build.patch
blob: e5c63c32d81475ab00b6e44761c6fd8f00c60447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/src/exim.c
+++ b/src/exim.c
@@ -642,13 +642,15 @@ exim_nullstd(void)
 {
 int devnull = -1;
 struct stat statbuf;
+const char devnullpath[] = "/dev/null";
+
 for (int i = 0; i <= 2; i++)
   {
   if (fstat(i, &statbuf) < 0 && errno == EBADF)
     {
-    if (devnull < 0) devnull = open("/dev/null", O_RDWR);
+    if (devnull < 0) devnull = open(devnullpath, O_RDWR);
     if (devnull < 0) log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s",
-      string_open_failed("/dev/null", NULL));
+      string_open_failed("%s", devnullpath));
     if (devnull != i) (void)dup2(devnull, i);
     }
   }
--- a/src/local_scan.h
+++ b/src/local_scan.h
@@ -27,6 +27,7 @@ store.c
 settings, and the store functions. */
 
 #include <stdarg.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #pragma GCC visibility push(default)
 #include "config.h"