On Fri, 2012-09-07 at 00:58 +0200, Guillem Jover wrote:
> On Wed, 2012-08-29 at 10:40:00 +0200, Svante Signell wrote:
> > Source: spl
> > Version: 1.0~pre6-3.1
> > Severity: Important
> > Tags: patch
> > Usertags: hurd
> > User: debian-h...@lists.debian.org
> 
> > --- 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)
> 
> This is a user defined variable, and as such might not really tell if
> the system will support that version of POSIX, you should use instead
> _POSIX_VERSION like you did in some other patch.

Yes, of course. Updated patch applied, also sent to the Debian bug:
#686162

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_VERSION >= 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_VERSION >= 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_VERSION >= 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 via email to