This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

getpwd tweek


I noticed the linker warning one gets from glibc when using
broken functions like getwd.


r~


	* getpwd.c: Check HAVE_GETCWD before defining it away.

Index: getpwd.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libiberty/getpwd.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 getpwd.c
*** getpwd.c	1999/08/31 00:50:36	1.1
--- getpwd.c	1999/08/31 20:31:49
*************** extern char *getwd ();
*** 34,50 ****
     BSD systems) now provides getcwd as called for by POSIX.  Allow for
     the few exceptions to the general rule here.  */
  
! #if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD)
  #define getcwd(buf,len) getwd(buf)
  #ifdef MAXPATHLEN
  #define GUESSPATHLEN (MAXPATHLEN + 1)
  #else
  #define GUESSPATHLEN 100
  #endif
- #else /* (defined (USG) || defined (VMS)) */
- /* We actually use this as a starting point, not a limit.  */
- #define GUESSPATHLEN 100
- #endif /* (defined (USG) || defined (VMS)) */
  
  #if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__)))
  
--- 34,48 ----
     BSD systems) now provides getcwd as called for by POSIX.  Allow for
     the few exceptions to the general rule here.  */
  
! #if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
  #define getcwd(buf,len) getwd(buf)
+ #endif
+ 
  #ifdef MAXPATHLEN
  #define GUESSPATHLEN (MAXPATHLEN + 1)
  #else
  #define GUESSPATHLEN 100
  #endif
  
  #if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__)))
  


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