[8/9] support: Use 64 bit time_t routines on support_can_chroot

Message ID 20230213171302.3045672-9-adhemerval.zanella@linaro.org
State Superseded
Headers
Series Use 64 bit time_t routines on support |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Adhemerval Zanella Feb. 13, 2023, 5:13 p.m. UTC
  The failure only shows if the system time is set past 2038.

Checked on i686-linux-gnu and on system emulated arm-linux-gnueabihf
with time set past y2038.
---
 support/support_can_chroot.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/support/support_can_chroot.c b/support/support_can_chroot.c
index 7d9f91205d..626022041a 100644
--- a/support/support_can_chroot.c
+++ b/support/support_can_chroot.c
@@ -16,6 +16,9 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#define _FILE_OFFSET_BITS 64
+#define _TIME_BITS 64
+
 #include <errno.h>
 #include <stdio.h>
 #include <support/check.h>
@@ -29,14 +32,14 @@  static void
 callback (void *closure)
 {
   int *result = closure;
-  struct stat64 before;
+  struct stat before;
   xstat ("/dev", &before);
   if (chroot ("/dev") != 0)
     {
       *result = errno;
       return;
     }
-  struct stat64 after;
+  struct stat after;
   xstat ("/", &after);
   TEST_VERIFY (before.st_dev == after.st_dev);
   TEST_VERIFY (before.st_ino == after.st_ino);