summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <christopher.halse.rogers@canonical.com>2011-03-09 11:17:27 +1100
committerAdam Jackson <ajax@redhat.com>2011-03-14 13:42:55 -0400
commitd17a9fb8414becf6a8998041df68f209f9222b2b (patch)
treebb8158a3323a7529de9fc7794589d6716317f4ed /include
parent021393d1b8bcc9ff2ff5deb2306360e6b0afa1c6 (diff)
Consolidate all the PATH_MAX handling into misc.h
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Diffstat (limited to 'include')
-rw-r--r--include/misc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/misc.h b/include/misc.h
index 0717db64d..b0abf9ac9 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -178,6 +178,17 @@ typedef struct _xReq *xReqPtr;
#endif
+#ifndef PATH_MAX
+#include <sys/param.h>
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+#endif
+
/**
* Calculate the number of bytes needed to hold bits.
* @param bits The minimum number of bits needed.