diff options
author | Michele Calgaro <[email protected]> | 2020-04-01 00:29:36 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2020-04-01 00:40:47 +0900 |
commit | 05d19ce7257c92714e44fe9ea2162ec9910a78f2 (patch) | |
tree | f133b8afbd4459d437d4b7f2816d60349351d80a /kppp/opener.cpp | |
parent | 27d394630c451a278ceb3861fad5be36d1657564 (diff) | |
download | tdenetwork-05d19ce7257c92714e44fe9ea2162ec9910a78f2.tar.gz tdenetwork-05d19ce7257c92714e44fe9ea2162ec9910a78f2.zip |
Fixed FTBFS in recent distros caused by flex arrays usage in kppp.
Based on the suggestion found here: https://github.com/UAVCAN/libuavcan/issues/116#issuecomment-346879320 (thanks!)
Signed-off-by: Michele Calgaro <[email protected]>
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 01cef504dd23de745b1a7e7096a6dfb1f07f35ae)
Diffstat (limited to 'kppp/opener.cpp')
-rw-r--r-- | kppp/opener.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kppp/opener.cpp b/kppp/opener.cpp index 5d90cc0e..7628681b 100644 --- a/kppp/opener.cpp +++ b/kppp/opener.cpp @@ -342,7 +342,13 @@ void Opener::mainLoop() { // int Opener::sendFD(int fd, struct ResponseHeader *response) { - struct { struct cmsghdr cmsg; int fd; } control; + union { + struct { + char _cmsg[sizeof(struct cmsghdr)]; + char data[sizeof(int)]; // int fd field + }; + struct cmsghdr cmsg; + } control; struct msghdr msg; struct iovec iov; |