summaryrefslogtreecommitdiffstats
path: root/newlib/libc/search/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/search/hash.c')
-rw-r--r--newlib/libc/search/hash.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/newlib/libc/search/hash.c b/newlib/libc/search/hash.c
index 0301fc03f..997acb3f6 100644
--- a/newlib/libc/search/hash.c
+++ b/newlib/libc/search/hash.c
@@ -141,9 +141,9 @@ _DEFUN(__hash_open, (file, flags, mode, info, dflags),
new_table = 0;
if (!file || (flags & O_TRUNC) ||
#ifdef __USE_INTERNAL_STAT64
- (stat64(file, &statbuf) && (errno == ENOENT))) {
+ (_stat64(file, &statbuf) && (errno == ENOENT))) {
#else
- (stat(file, &statbuf) && (errno == ENOENT))) {
+ (_stat(file, &statbuf) && (errno == ENOENT))) {
#endif
if (errno == ENOENT)
errno = 0; /* Just in case someone looks at errno */
@@ -157,9 +157,9 @@ _DEFUN(__hash_open, (file, flags, mode, info, dflags),
a new .db file, then reinitialize the database */
if ((flags & O_CREAT) &&
#ifdef __USE_INTERNAL_STAT64
- fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
+ _fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
#else
- fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
+ _fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
#endif
new_table = 1;
@@ -316,7 +316,11 @@ init_hash(hashp, file, info)
const char *file;
const HASHINFO *info;
{
+#ifdef __USE_INTERNAL_STAT64
+ struct stat64 statbuf;
+#else
struct stat statbuf;
+#endif
int nelem;
nelem = 1;
@@ -335,9 +339,9 @@ init_hash(hashp, file, info)
/* Fix bucket size to be optimal for file system */
if (file != NULL) {
#ifdef __USE_INTERNAL_STAT64
- if (stat64(file, &statbuf))
+ if (_stat64(file, &statbuf))
#else
- if (stat(file, &statbuf))
+ if (_stat(file, &statbuf))
#endif
return (NULL);
hashp->BSIZE = statbuf.st_blksize;