]> granicus.if.org Git - p11-kit/commitdiff
Don't use PATH_MAX unless its defined
authorPino Toscano <pino@debian.org>
Fri, 30 Sep 2011 12:28:00 +0000 (14:28 +0200)
committerStef Walter <stefw@collabora.co.uk>
Fri, 30 Sep 2011 12:28:00 +0000 (14:28 +0200)
 * Fixes build on GNU/Hurd

https://bugs.freedesktop.org/show_bug.cgi?id=41303\1a

p11-kit/modules.c

index 4c87ceee7afa18456bb966d31175d0ad60fa4adc..c0a000a18790e0611d48eeba3f26f5cac716af5f 100644 (file)
@@ -263,9 +263,14 @@ build_path (const char *dir, const char *filename)
        assert (filename);
 
        len = snprintf (NULL, 0, "%s/%s", dir, filename) + 1;
-       if (len <= 0 || len > PATH_MAX)
+       if (len <= 0)
                return NULL;
 
+#ifdef PATH_MAX
+       if (len > PATH_MAX)
+               return NULL;
+#endif
+
        if (!(path = malloc (len)))
                return NULL;