Package: gearmand
Version: 0.32-2
Severity: important
User: debian-h...@lists.debian.org
Usertags: hurd
Tags: patch

Hi,

Currently gearmand fails to build on Debian GNU/Hurd due to an unconditional 
use of PATH_MAX which
we do not define.

Attached is a patch for building on Hurd.

Thank you,

Barry deFreese

Index: gearmand-0.32/libtest/server.cc
===================================================================
--- gearmand-0.32.orig/libtest/server.cc        2012-06-18 17:52:26.000000000 
+0000
+++ gearmand-0.32/libtest/server.cc     2012-06-18 19:20:31.000000000 +0000
@@ -76,6 +76,22 @@
   return output;  // for multiple << operators
 }
 
+#ifdef __GLIBC__
+namespace {
+
+class Buffer
+{
+public:
+  Buffer(char *b) : b_(b) {}
+   ~Buffer() { free(b_); }
+  char* buf() { return b_; }
+private:
+  char *b_;
+};
+
+}
+#endif // __GLIBC__
+
 #define MAGIC_MEMORY 123570
 
 Server::Server(const std::string& host_arg, const in_port_t port_arg,
@@ -204,8 +220,14 @@
           continue;
         }
 
+#ifdef __GLIBC__
+        Buffer buf( get_current_dir_name());
+        char *getcwd_buf= buf.buf();
+#else
         char buf[PATH_MAX];
         char *getcwd_buf= getcwd(buf, sizeof(buf));
+#endif // __GLIBC__
+
         throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
                              "Unable to open pidfile in %s for: %s stderr:%s",
                              getcwd_buf ? getcwd_buf : "",

Reply via email to