076f82
commit b3f935940ebcdf553b64e74fdf65dfd4858821ad
076f82
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
076f82
Date:   Tue May 31 12:51:43 2022 -0300
076f82
076f82
    iconv: Use 64 bit stat for gconv_parseconfdir (BZ# 29213)
076f82
    
076f82
    The issue is only when used within libc.so (iconvconfig already builds
076f82
    with _TIME_SIZE=64).
076f82
    
076f82
    This is a missing spot initially from 52a5fe70a2c77935.
076f82
    
076f82
    Checked on i686-linux-gnu.
076f82
    
076f82
    (cherry picked from commit c789e6e40974e2b67bd33a17f29b20dce6ae8822)
076f82
076f82
diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
076f82
index a586268abc103abd..79398a980cde84e3 100644
076f82
--- a/iconv/gconv_parseconfdir.h
076f82
+++ b/iconv/gconv_parseconfdir.h
076f82
@@ -32,8 +32,11 @@
076f82
 # define readdir __readdir
076f82
 # define closedir __closedir
076f82
 # define mempcpy __mempcpy
076f82
-# define lstat64 __lstat64
076f82
+# define struct_stat struct __stat64_t64
076f82
+# define lstat __lstat64_time64
076f82
 # define feof_unlocked __feof_unlocked
076f82
+#else
076f82
+# define struct_stat struct stat
076f82
 #endif
076f82
 
076f82
 /* Name of the file containing the module information in the directories
076f82
@@ -158,12 +161,12 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
076f82
 	      && strcmp (ent->d_name + len - strlen (suffix), suffix) == 0)
076f82
 	    {
076f82
 	      char *conf;
076f82
-	      struct stat64 st;
076f82
+	      struct_stat st;
076f82
 	      if (asprintf (&conf, "%s/%s", buf, ent->d_name) < 0)
076f82
 		continue;
076f82
 
076f82
 	      if (ent->d_type != DT_UNKNOWN
076f82
-		  || (lstat64 (conf, &st) != -1 && S_ISREG (st.st_mode)))
076f82
+		  || (lstat (conf, &st) != -1 && S_ISREG (st.st_mode)))
076f82
 		found |= read_conf_file (conf, dir, dir_len);
076f82
 
076f82
 	      free (conf);