Bug#758890: lua-filesystem: FTBFS on hurd-i386
Source: lua-filesystem
Version: 1.6.2-1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd
Hi,
lua-filesystem fails to build from source on GNU/Hurd due to MAXPATHLEN
usage in src/lfs.c, which is not defined. Since the source comment says
that getcwd(NULL,0) is not guaranteed to work, use _POSIX_PATH_MAX as a
last resort. The attached patch fixes this problem. Additionally the
six tests pass enabling the packages to build.
In case the package had been using configure a test for a working
getcwd (NULL, 0) could have been included, and the source modified
accordingly.
Thanks!
--- a/src/lfs.c.orig 2012-10-04 16:00:22.000000000 +0200
+++ b/src/lfs.c 2014-08-22 15:29:44.000000000 +0200
@@ -84,7 +84,12 @@
#define LFS_MAXPATHLEN MAX_PATH // MAX_PATH seems to be 260. Seems kind of small. Is there a better one?
#else
#include <sys/param.h> // for MAXPATHLEN
- #define LFS_MAXPATHLEN MAXPATHLEN
+ #ifdef MAXPATHLEN
+ #define LFS_MAXPATHLEN MAXPATHLEN
+ #else
+ #include <limits.h> // for _POSIX_PATH_MAX
+ #define LFS_MAXPATHLEN _POSIX_PATH_MAX
+ #endif
#endif
#endif
Reply to: