This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
intl patches (18)
- To: libc-alpha at sources dot redhat dot com
- Subject: intl patches (18)
- From: Bruno Haible <haible at ilog dot fr>
- Date: Mon, 19 Mar 2001 22:41:46 +0100 (CET)
stat64 is not portable. Outside glibc normal 'stat' is the best thing use
for libintl. (The message catalogs never will be 2 GB large. Also, I cannot
simply '#define stat64 stat' to work around the problem, because <sys/stat.h>
does '#define stat stat64' when __USE_FILE_OFFSET64 is defined and __REDIRECT
is not.)
2001-03-17 Bruno Haible <haible@clisp.cons.org>
* intl/loadmsgcat.c (_nl_load_domain) [!_LIBC]: Use fstat, not
fstat64.
diff -r -c3 intl/loadmsgcat.c intl-100/loadmsgcat.c
*** intl/loadmsgcat.c Sat Mar 17 19:47:06 2001
--- intl/loadmsgcat.c Sat Mar 17 23:39:33 2001
***************
*** 210,216 ****
--- 216,226 ----
{
int fd;
size_t size;
+ #ifdef _LIBC
struct stat64 st;
+ #else
+ struct stat st;
+ #endif
struct mo_file_header *data = (struct mo_file_header *) -1;
int use_mmap = 0;
struct loaded_domain *domain;
***************
*** 233,239 ****
return;
/* We must know about the size of the file. */
! if (__builtin_expect (fstat64 (fd, &st) != 0, 0)
|| __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
|| __builtin_expect (size < sizeof (struct mo_file_header), 0))
{
--- 243,254 ----
return;
/* We must know about the size of the file. */
! if (
! #ifdef _LIBC
! __builtin_expect (fstat64 (fd, &st) != 0, 0)
! #else
! __builtin_expect (fstat (fd, &st) != 0, 0)
! #endif
|| __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
|| __builtin_expect (size < sizeof (struct mo_file_header), 0))
{