Source: nghttp2
Version: 0.6.1-1
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

Currently nghttp2 fails to build from source due to usage of PATH_MAX,
which is not defined on GNU/Hurd. It did build before, and the latest
Hurd version is 0.4.1-1. Only one file needs a small modification, see
the attached path. This patch assumes getcwd(NULL,0) works. 

Depending on for which systems this software is aimed at, a
configure.ac check can be added. This patch should work for at
least all Debian supported OSes (libc4, libc5, glibc).

Thanks!

--- a/src/shrpx.cc.orig	2014-09-10 17:32:07.000000000 +0200
+++ b/src/shrpx.cc	2014-09-24 16:20:37.000000000 +0200
@@ -1225,9 +1225,7 @@
     mod_config()->argv[i] = strdup(argv[i]);
   }
 
-  char cwd[PATH_MAX];
-
-  mod_config()->cwd = getcwd(cwd, sizeof(cwd));
+  mod_config()->cwd = getcwd(NULL, 0);
   if(mod_config()->cwd == nullptr) {
     auto error = errno;
     LOG(FATAL) << "failed to get current working directory: errno=" << error;

Reply via email to