Bug#686162: spl: FTBFS on hurd-386
Source: spl
Version: 1.0~pre6-3.1
Severity: important
Tags: patch
Usertags: hurd
User: debian-hurd@lists.debian.org
Hi, the attached patch enable a successful build of spl on GNU/Hurd
which does not build due to a single PATH_MAX issue. Upstream regards
this software as mature, the latest release was made in November 2009.
See
http://www.rocklinux.net/pipermail/spl/2009-November/000410.html
http://www.rocklinux.net/pipermail/spl/2011-December/000423.html
for more info.
Therefore I'll try to explain where the changes are made.
The call sequence is as follows: (only the POSIX 2008 case)
webspld.c: (save for indentation)
...
static char *daemon_basedir = ".";
...
int main(int argc, char **argv)
...
daemon_basedir = getcwd(NULL, 0);
...
listen_loop();
...
free(pool);
free(daemon_basedir);
...
static void listen_loop()
...
handle_conn(&args);
...
static void *handle_conn(void *args_p)
...
handle_http_request(args->fd,
webspld_vm_pool_get, webspld_vm_pool_put,
code_cache_list ? cached_filename_to_codepage : 0);
...
static struct spl_vm *webspld_vm_pool_get(const char *session,
int create)
...
my_asprintf(&pool[oldest_entry].vm->path,
".:./spl_modules:%s/spl_modules:%s",
daemon_basedir, spl_system_modules_dir());
...
Thanks!
--- a/webspld.c 2008-09-18 16:34:23.000000000 +0200
+++ b/webspld.c 2012-08-29 10:36:29.000000000 +0200
@@ -62,7 +62,11 @@
static int pool_size = 32;
static struct pool_entry *pool = 0;
+#if (_POSIX_C_SOURCE >= 200809L)
+static char *daemon_basedir = ".";
+#else
static char daemon_basedir[PATH_MAX] = ".";
+#endif
struct code_cache {
char *filename;
@@ -640,7 +644,11 @@
struct sockaddr_in addr;
struct linger sl = { 1, 5 };
+#if (_POSIX_C_SOURCE >= 200809L)
+ daemon_basedir = getcwd(NULL, 0);
+#else
getcwd(daemon_basedir, PATH_MAX);
+#endif
printf("Loading SPL CGI module.\n");
SPL_REGISTER_BUILTIN_MODULE(cgi);
@@ -707,7 +715,9 @@
webspld_vm_pool_cleanup();
SPL_FREE_BUILTIN_MODULES();
free(pool);
-
+#if (_POSIX_C_SOURCE >= 200809L)
+ free(daemon_basedir);
+#endif
if (code_cache_size) {
for (int i=0; i<code_cache_size; i++)
free_code_cache(code_cache_list + i);
Reply to: