Use MAXPATHLEN when no PATH_MAX.

This commit is contained in:
Andrew Cagney 2002-01-20 00:44:47 +00:00
parent ee1f65f0e3
commit 2d1b2124ee
2 changed files with 13 additions and 0 deletions

View 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.

View 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