This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Use MAXPATHLEN, fix sunos build problem


FYI,

I've checked in the attached to fix a build problem on SunOS 4.x.

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

Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.55
diff -p -r1.55 utils.c
*** utils.c	2002/01/17 23:33:38	1.55
--- utils.c	2002/01/20 00:41:53
***************
*** 54,59 ****
--- 54,61 ----
  
  #include "inferior.h" /* for signed_pointer_to_address */
  
+ #include <sys/param.h>		/* For MAXPATHLEN */
+ 
  #include <readline/readline.h>
  
  #ifdef USE_MMALLOC
*************** char *
*** 2538,2544 ****
--- 2540,2552 ----
  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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]