]> Savannah Git Hosting - gnulib.git/commitdiff
getcwd: merge recent glibc changes
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Sep 2020 01:28:36 +0000 (18:28 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Sep 2020 01:29:46 +0000 (18:29 -0700)
* lib/getcwd.c (GETCWD_RETURN_TYPE) [!_LIBC]: New macro.
(__getcwd, getcwd) [_LIBC && !GETCWD_RETURN_TYPE]: Add aliases.

ChangeLog
lib/getcwd.c

index ff4bee30638e537dadcd6fa5d41068dc8575aa73..c554e5672ce77d4c30561d9fedec1efbc0801b12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-09-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       getcwd: merge recent glibc changes
+       * lib/getcwd.c (GETCWD_RETURN_TYPE) [!_LIBC]: New macro.
+       (__getcwd, getcwd) [_LIBC && !GETCWD_RETURN_TYPE]: Add aliases.
+
 2020-09-06  Bruno Haible  <bruno@clisp.org>
 
        attribute: Clarify which file to include.
index 61d2d0610639ff04a6012208d2b19de11b10d811..9b74b7b0c7cbc8592079aaff0f7852ed8e558048 100644 (file)
@@ -89,6 +89,7 @@
 #endif
 
 #if !_LIBC
+# define GETCWD_RETURN_TYPE char *
 # define __close_nocancel_nostatus close
 # define __getcwd_generic rpl_getcwd
 # define stat64    stat
@@ -154,7 +155,7 @@ getcwd_nothrow (char *buf, size_t size)
    if BUF is NULL, an array is allocated with 'malloc'; the array is SIZE
    bytes long, unless SIZE == 0, in which case it is as big as necessary.  */
 
-char *
+GETCWD_RETURN_TYPE
 __getcwd_generic (char *buf, size_t size)
 {
   /* Lengths of big file name components and entire file names, and a
@@ -487,3 +488,8 @@ __getcwd_generic (char *buf, size_t size)
   }
   return NULL;
 }
+
+#if defined _LIBC && !defined GETCWD_RETURN_TYPE
+libc_hidden_def (__getcwd)
+weak_alias (__getcwd, getcwd)
+#endif