This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
getpwd tweek
- To: gcc-patches at gcc dot gnu dot org
- Subject: getpwd tweek
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 31 Aug 1999 13:34:22 -0700
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__)))