diff --git a/debian/patches/kfreebsd-build-fix.patch b/debian/patches/kfreebsd-build-fix.patch new file mode 100644 index 00000000..000dcadc --- /dev/null +++ b/debian/patches/kfreebsd-build-fix.patch @@ -0,0 +1,41 @@ +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +Description: Avoid usage of F_DUPFD_CLOEXEC where not available (e.g. kfreebsd*) + The patch is mostly taken from 10_kfreebsd-f_dupfd_cloexec.patch (gnome-terminal) + Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711529 + Description: Fix build on kfreebsd + + kfreebsd doesn't have F_DUPFD_CLOEXEC, so use it conditionally. + As mentioned in the bug report, it will have support for it in + jessie, so we can drop it in jessie+1 + Author: Emilio Pozuelo Monfort + Author: Petr Salinger + +Author: Gianfranco Costamagna +--- llvm-toolchain-3.7-3.7~+rc3.orig/lldb/source/Plugins/Process/FreeBSD/ProcessPOSIX.cpp ++++ llvm-toolchain-3.7-3.7~+rc3/lldb/source/Plugins/Process/FreeBSD/ProcessPOSIX.cpp +@@ -214,11 +214,24 @@ ProcessPOSIX::DoLaunch (Module *module, + int terminal = m_monitor->GetTerminalFD(); + if (terminal >= 0) { + // The reader thread will close the file descriptor when done, so we pass it a copy. ++#ifdef F_DUPFD_CLOEXEC + int stdio = fcntl(terminal, F_DUPFD_CLOEXEC, 0); + if (stdio == -1) { + error.SetErrorToErrno(); + return error; + } ++#else ++ int stdio = fcntl(terminal, F_DUPFD, 0); ++ if (stdio == -1) { ++ error.SetErrorToErrno(); ++ return error; ++ } ++ stdio = fcntl(terminal, F_SETFD, FD_CLOEXEC); ++ if (stdio == -1) { ++ error.SetErrorToErrno(); ++ return error; ++ } ++#endif + SetSTDIOFileDescriptor(stdio); + }