aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-01-20 00:44:47 +0000
committerAndrew Cagney <cagney@redhat.com>2002-01-20 00:44:47 +0000
commit2d1b2124ee669f4bec0290923ee79c533c65524e (patch)
tree6c58a1667d2941aa7305fd8233230ed7a22128af /gdb/utils.c
parentee1f65f0e30d3346efaf28c81ba491e5403ec708 (diff)
downloadgdb-2d1b2124ee669f4bec0290923ee79c533c65524e.zip
gdb-2d1b2124ee669f4bec0290923ee79c533c65524e.tar.gz
gdb-2d1b2124ee669f4bec0290923ee79c533c65524e.tar.bz2
Use MAXPATHLEN when no PATH_MAX.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 83d1a97..e5182af 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -54,6 +54,8 @@
#include "inferior.h" /* for signed_pointer_to_address */
+#include <sys/param.h> /* For MAXPATHLEN */
+
#include <readline/readline.h>
#ifdef USE_MMALLOC
@@ -2538,7 +2540,13 @@ char *
gdb_realpath (const char *filename)
{
#ifdef HAVE_REALPATH
+#if defined (PATH_MAX)
char buf[PATH_MAX];
+#elif defined (MAXPATHLEN)
+ char buf[MAXPATHLEN];
+#else
+#error "Neither PATH_MAX nor MAXPATHLEN defined"
+#endif
char *rp = realpath (filename, buf);
return xstrdup (rp ? rp : filename);
#else