[Pkg-nagios-changes] [pkg-icinga2] 01/01: Adding patches for arch problems on Hurd and FreeBSD
Markus Frosch
lazyfrosch at moszumanska.debian.org
Thu Sep 4 19:32:49 UTC 2014
This is an automated email from the git hooks/post-receive script.
lazyfrosch pushed a commit to branch master
in repository pkg-icinga2.
commit 280f89272ba4ae21f23ee618f46db3ee409fd400
Author: Markus Frosch <lazyfrosch at debian.org>
Date: Thu Sep 4 21:04:52 2014 +0200
Adding patches for arch problems on Hurd and FreeBSD
- Issues with PIPE2 on both Hurd and FreeBSD
- PATH_MAX Problem on Hurd
See patches for reference to upstream commit.
---
debian/patches/gnu_hurd.patch | 21 ++++++++++
debian/patches/pipe_ENOSYS.patch | 89 ++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 2 +
3 files changed, 112 insertions(+)
diff --git a/debian/patches/gnu_hurd.patch b/debian/patches/gnu_hurd.patch
new file mode 100644
index 0000000..79d6b94
--- /dev/null
+++ b/debian/patches/gnu_hurd.patch
@@ -0,0 +1,21 @@
+commit 4da18d6de1b064f12acf3a47ea2bce1ce50445a0
+Author: Gunnar Beutner <gunnar at beutner.name>
+Date: Tue Sep 2 17:27:16 2014 +0200
+
+ Build fix for GNU Hurd
+
+diff --git a/lib/base/unix.hpp b/lib/base/unix.hpp
+index 4a4197c..d4dcabc 100644
+--- a/lib/base/unix.hpp
++++ b/lib/base/unix.hpp
+@@ -48,6 +48,10 @@ typedef int SOCKET;
+ #define closesocket close
+ #define ioctlsocket ioctl
+
++#ifndef PATH_MAX
++# define PATH_MAX 1024
++#endif /* PATH_MAX */
++
+ #ifndef MAXPATHLEN
+ # define MAXPATHLEN PATH_MAX
+ #endif /* MAXPATHLEN */
diff --git a/debian/patches/pipe_ENOSYS.patch b/debian/patches/pipe_ENOSYS.patch
new file mode 100644
index 0000000..353262f
--- /dev/null
+++ b/debian/patches/pipe_ENOSYS.patch
@@ -0,0 +1,89 @@
+commit 039a13cf88a597050215541d65272c4784423b1a
+Author: Gunnar Beutner <gunnar at beutner.name>
+Date: Wed Sep 3 08:10:55 2014 +0200
+
+ Implement support for systems where pipe2 returns ENOSYS
+
+ fixes #7065
+ fixes #6696
+
+diff --git a/lib/base/process.cpp b/lib/base/process.cpp
+index 46de696..96efbb0 100644
+--- a/lib/base/process.cpp
++++ b/lib/base/process.cpp
+@@ -71,23 +71,24 @@ void Process::StaticInitialize(void)
+ #else /* _WIN32 */
+ # ifdef HAVE_PIPE2
+ if (pipe2(l_EventFDs[tid], O_CLOEXEC) < 0) {
+- BOOST_THROW_EXCEPTION(posix_error()
+- << boost::errinfo_api_function("pipe2")
+- << boost::errinfo_errno(errno));
+- }
+-# else /* HAVE_PIPE2 */
+- if (pipe(l_EventFDs[tid]) < 0) {
+- BOOST_THROW_EXCEPTION(posix_error()
+- << boost::errinfo_api_function("pipe")
+- << boost::errinfo_errno(errno));
+- }
+-
+- Utility::SetCloExec(l_EventFDs[tid][0]);
+- Utility::SetCloExec(l_EventFDs[tid][1]);
++ if (errno == ENOSYS) {
+ # endif /* HAVE_PIPE2 */
++ if (pipe(l_EventFDs[tid]) < 0) {
++ BOOST_THROW_EXCEPTION(posix_error()
++ << boost::errinfo_api_function("pipe")
++ << boost::errinfo_errno(errno));
++ }
+
+- Utility::SetNonBlocking(l_EventFDs[tid][0]);
+- Utility::SetNonBlocking(l_EventFDs[tid][1]);
++ Utility::SetCloExec(l_EventFDs[tid][0]);
++ Utility::SetCloExec(l_EventFDs[tid][1]);
++# ifdef HAVE_PIPE2
++ } else {
++ BOOST_THROW_EXCEPTION(posix_error()
++ << boost::errinfo_api_function("pipe2")
++ << boost::errinfo_errno(errno));
++ }
++ }
++# endif /* HAVE_PIPE2 */
+ #endif /* _WIN32 */
+ }
+ }
+@@ -444,19 +445,23 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
+
+ #ifdef HAVE_PIPE2
+ if (pipe2(fds, O_CLOEXEC) < 0) {
+- BOOST_THROW_EXCEPTION(posix_error()
+- << boost::errinfo_api_function("pipe2")
+- << boost::errinfo_errno(errno));
+- }
+-#else /* HAVE_PIPE2 */
+- if (pipe(fds) < 0) {
+- BOOST_THROW_EXCEPTION(posix_error()
+- << boost::errinfo_api_function("pipe")
+- << boost::errinfo_errno(errno));
+- }
++ if (errno == ENOSYS) {
++#endif /* HAVE_PIPE2 */
++ if (pipe(fds) < 0) {
++ BOOST_THROW_EXCEPTION(posix_error()
++ << boost::errinfo_api_function("pipe")
++ << boost::errinfo_errno(errno));
++ }
+
+- Utility::SetCloExec(fds[0]);
+- Utility::SetCloExec(fds[1]);
++ Utility::SetCloExec(fds[0]);
++ Utility::SetCloExec(fds[1]);
++#ifdef HAVE_PIPE2
++ } else {
++ BOOST_THROW_EXCEPTION(posix_error()
++ << boost::errinfo_api_function("pipe2")
++ << boost::errinfo_errno(errno));
++ }
++ }
+ #endif /* HAVE_PIPE2 */
+
+ // build argv
diff --git a/debian/patches/series b/debian/patches/series
index e1c16fd..fc76b56 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
+gnu_hurd.patch
+pipe_ENOSYS.patch
21_config_changes
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-icinga2.git
More information about the Pkg-nagios-changes
mailing list