summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <pino@debian.org>2011-09-30 14:28:00 +0200
committerStef Walter <stefw@collabora.co.uk>2011-09-30 14:28:00 +0200
commit85d9078be0456de8014a6f186f3916ddb01792d2 (patch)
tree4ac8c2de8c54bf1aa87f3762b5cd799c40fb2747
parent639aa9e38692ba5001987bb496e10cca14880807 (diff)
downloadp11-kit-85d9078be0456de8014a6f186f3916ddb01792d2.tar.gz
Don't use PATH_MAX unless its defined
* Fixes build on GNU/Hurd https://bugs.freedesktop.org/show_bug.cgi?id=41303
-rw-r--r--p11-kit/modules.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index 4c87cee..c0a000a 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -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;