[8/9] support: Use 64 bit time_t routines on support_can_chroot
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
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(-)
@@ -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);