Use MAXPATHLEN when no PATH_MAX.
authorAndrew Cagney <cagney@redhat.com>
Sun, 20 Jan 2002 00:44:47 +0000 (00:44 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 20 Jan 2002 00:44:47 +0000 (00:44 +0000)
gdb/ChangeLog
gdb/utils.c

index 8ef59a15aba6b9f53f5a63118911b1e5b6e209f0..9e68687302af727445e8456b902902693affed8a 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-19  Andrew Cagney  <ac131313@redhat.com>
+
+       * utils.c: Include <sys/param.h> for MAXPATHLEN.
+       (gdb_realpath): Use MAXPATHLEN when PATH_MAX is not defined.
+
 2002-01-19  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * alpha-tdep.c (alpha_call_dummy_words): New.
index 83d1a97523902278ca95fc48ac520934a5404297..e5182af6cde0dfeee6d91431aa64fceb00edb01e 100644 (file)
@@ -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
This page took 0.030842 seconds and 4 git commands to generate.