8324539: Do not use LFS64 symbols in JDK libs

Reviewed-by: jwaters, erikj, mbaesken, alanb
This commit is contained in:
Magnus Ihse Bursie 2024-02-12 08:04:39 +00:00
parent efa071dd06
commit e5cb78cc88
29 changed files with 166 additions and 287 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -54,12 +54,6 @@ static char *isFileIdentical(char* buf, size_t size, char *pathname);
#define filegets fgets
#define fileclose fclose
#if defined(_ALLBSD_SOURCE)
#define stat64 stat
#define lstat64 lstat
#define fstat64 fstat
#endif
#if defined(__linux__) || defined(_ALLBSD_SOURCE)
static const char *ETC_TIMEZONE_FILE = "/etc/timezone";
static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
@ -219,12 +213,12 @@ static char *
isFileIdentical(char *buf, size_t size, char *pathname)
{
char *possibleMatch = NULL;
struct stat64 statbuf;
struct stat statbuf;
char *dbuf = NULL;
int fd = -1;
int res;
RESTARTABLE(stat64(pathname, &statbuf), res);
RESTARTABLE(stat(pathname, &statbuf), res);
if (res == -1) {
return NULL;
}
@ -264,7 +258,7 @@ isFileIdentical(char *buf, size_t size, char *pathname)
static char *
getPlatformTimeZoneID()
{
struct stat64 statbuf;
struct stat statbuf;
char *tz = NULL;
FILE *fp;
int fd;
@ -301,7 +295,7 @@ getPlatformTimeZoneID()
/*
* Next, try /etc/localtime to find the zone ID.
*/
RESTARTABLE(lstat64(DEFAULT_ZONEINFO_FILE, &statbuf), res);
RESTARTABLE(lstat(DEFAULT_ZONEINFO_FILE, &statbuf), res);
if (res == -1) {
return NULL;
}
@ -343,7 +337,7 @@ getPlatformTimeZoneID()
return NULL;
}
RESTARTABLE(fstat64(fd, &statbuf), res);
RESTARTABLE(fstat(fd, &statbuf), res);
if (res == -1) {
(void) close(fd);
return NULL;