summaryrefslogtreecommitdiffstats
path: root/patches/systemd-230/0010-HACK-fix-building-without-linux-sctp.h.patch
blob: 640acba5af0dc55ebafe121f122a67e6a06dbd74 (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
31
32
33
34
35
36
37
38
39
40
41
42
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Mon, 18 Apr 2016 12:22:22 +0200
Subject: [PATCH] HACK: fix building without linux/sctp.h

linux/sctp.h exists since kernel 3.10.

Upstream requires kernel 3.11 but this is useful for host-systemd.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 configure.ac      | 1 +
 src/core/socket.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 650a5be1edf2..f7eb2c4f963f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -292,6 +292,7 @@ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers n
 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
 AC_CHECK_HEADERS([linux/memfd.h], [], [])
 AC_CHECK_HEADERS([uchar.h], [], [])
+AC_CHECK_HEADERS([linux/sctp.h], [], [])
 
 # unconditionally pull-in librt with old glibc versions
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
diff --git a/src/core/socket.c b/src/core/socket.c
index f6204d04bfd8..212ff2dd913d 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -26,7 +26,11 @@
 #include <sys/epoll.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#ifdef HAVE_LINUX_SCTP_H
 #include <linux/sctp.h>
+#else
+#define SCTP_NODELAY 3
+#endif
 
 #include "alloc-util.h"
 #include "bus-error.h"