summaryrefslogtreecommitdiff
path: root/system.h
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-03 14:13:45 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-03 14:14:14 +0200
commit759b73a4293e56209e922bf58d7028234e854338 (patch)
tree73a0b25f0c80c1a07d091bd035957dad3788e85c /system.h
parentb7678c0a40898debdf7396c84967411efbfaf345 (diff)
downloadrpm-759b73a4293e56209e922bf58d7028234e854338.tar.gz
rpm-759b73a4293e56209e922bf58d7028234e854338.tar.bz2
rpm-759b73a4293e56209e922bf58d7028234e854338.zip
Ensure PATH_MAX is defined (ticket #3) Adam Tkac
- POSIX doesn't require PATH_MAX to be defined as constant, and Hurd doesn't define it... - deal with it just once in system.h for now, the proper fix is to get rid of needing it at all (ie add a mallocing realpath() clone to librpmio) - patch from Adam Tkac
Diffstat (limited to 'system.h')
-rw-r--r--system.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/system.h b/system.h
index 8c2f8150f..64c4003de 100644
--- a/system.h
+++ b/system.h
@@ -181,6 +181,16 @@ char *realpath(const char *path, char resolved_path []);
#include <limits.h>
#endif
+#ifndef PATH_MAX
+#ifdef _POSIX_PATH_MAX
+#define PATH_MAX _POSIX_PATH_MAX
+#elif defined MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 256
+#endif
+#endif
+
#if HAVE_ERR_H
#include <err.h>
#endif