From fcdbd910679997f257de70e9e49801dc4db93222 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 20 Aug 2020 09:04:16 -0300 Subject: Sync getcwd with gnulib This is the first of a series of patches to sync with Gnulib commit 615b43e1f9. This patch adopts most of the changes of Gnulib, except it retains GETCWD_RETURN_TYPE and does not always use a 64-bit internal API. These remaining discrepancies will be addressed in later patches in this series. Checked on x86_64-linux-gnu and i686-linux-gnu. --- sysdeps/unix/sysv/linux/getcwd.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sysdeps/unix/sysv/linux/getcwd.c') diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c index fabc4bb8cc..c5886f5283 100644 --- a/sysdeps/unix/sysv/linux/getcwd.c +++ b/sysdeps/unix/sysv/linux/getcwd.c @@ -40,7 +40,10 @@ named `cwd'. Reading the content of this link immediate gives us the information. But we have to take care for systems which do not have the proc filesystem mounted. Use the POSIX implementation in this case. */ -static char *generic_getcwd (char *buf, size_t size); + +/* Get the code for the generic version. */ +#define GETCWD_RETURN_TYPE static char * +#include char * __getcwd (char *buf, size_t size) @@ -105,7 +108,7 @@ __getcwd (char *buf, size_t size) } #endif - result = generic_getcwd (path, size); + result = __getcwd_generic (path, size); #ifndef NO_ALLOCATION if (result == NULL && buf == NULL && size != 0) @@ -129,8 +132,3 @@ __getcwd (char *buf, size_t size) } libc_hidden_def (__getcwd) weak_alias (__getcwd, getcwd) - -/* Get the code for the generic version. */ -#define GETCWD_RETURN_TYPE static char * -#define __getcwd generic_getcwd -#include -- cgit 1.4.1