diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-05-12 11:09:39 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-05-12 11:09:39 +0000 |
commit | 11e3a52072b7ccc02ddbf518ea70a3d8a0909069 (patch) | |
tree | 0ea9a65302d2bfe65a79c0f2b09613a9d6292880 /newlib/libc/search/hash.c | |
parent | 194d9eb318403b1618c3f77eba6de4e17b7c900d (diff) | |
download | cygnal-11e3a52072b7ccc02ddbf518ea70a3d8a0909069.tar.gz cygnal-11e3a52072b7ccc02ddbf518ea70a3d8a0909069.tar.bz2 cygnal-11e3a52072b7ccc02ddbf518ea70a3d8a0909069.zip |
* configure.host: Accomodate removing the libc/sys/cygwin dir.
* libc/locale/ldpart.c (__part_load_locale): Use 64 bit stat call
if __CYGWIN_USE_BIG_TYPES__ is set.
* libc/search/hash.c (__hash_open): Ditto.
(init_hash): Ditto.
* libc/stdio/fseek.c (fseek): Ditto.
* libc/stdio/makebuf.c (__smakebuf): Ditto.
* libc/stdio/mktemp.c (_gettemp): Ditto.
* libc/sys/cygwin/Makefile.am: Remove.
* libc/sys/cygwin/Makefile.in: Remove.
* libc/sys/cygwin/aclocal.m4: Remove.
* libc/sys/cygwin/configure: Remove.
* libc/sys/cygwin/configure.in: Remove.
* libc/sys/cygwin/crt0.c: Move to winsup/cygwin directory.
* libc/sys/cygwin/sys/dirent.h: Move to winsup/cygwin/include/sys
directory.
* libc/sys/cygwin/sys/param.h: Ditto.
* libc/sys/cygwin/sys/utime.h: Ditto.
* libc/sys/cygwin/sys/utmp.h: Ditto.
Diffstat (limited to 'newlib/libc/search/hash.c')
-rw-r--r-- | newlib/libc/search/hash.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/newlib/libc/search/hash.c b/newlib/libc/search/hash.c index 10b4ded47..5429252b1 100644 --- a/newlib/libc/search/hash.c +++ b/newlib/libc/search/hash.c @@ -105,6 +105,7 @@ __hash_open(file, flags, mode, info, dflags) const HASHINFO *info; /* Special directives for create */ { HTAB *hashp; + struct stat statbuf; DB *dbp; int bpages, hdrsize, new_table, nsegs, save_errno; @@ -128,7 +129,11 @@ __hash_open(file, flags, mode, info, dflags) new_table = 0; if (!file || (flags & O_TRUNC) || +#ifdef __CYGWIN_USE_BIG_TYPES__ + (stat64(file, &statbuf) && (errno == ENOENT))) { +#else (stat(file, &statbuf) && (errno == ENOENT))) { +#endif if (errno == ENOENT) errno = 0; /* Just in case someone looks at errno */ new_table = 1; @@ -140,7 +145,11 @@ __hash_open(file, flags, mode, info, dflags) /* if the .db file is empty, and we had permission to create a new .db file, then reinitialize the database */ if ((flags & O_CREAT) && +#ifdef __CYGWIN_USE_BIG_TYPES__ + fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0) +#else fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0) +#endif new_table = 1; #ifdef HAVE_FCNTL @@ -314,7 +323,11 @@ init_hash(hashp, file, info) /* Fix bucket size to be optimal for file system */ if (file != NULL) { +#ifdef __CYGWIN_USE_BIG_TYPES__ + if (stat64(file, &statbuf)) +#else if (stat(file, &statbuf)) +#endif return (NULL); hashp->BSIZE = statbuf.st_blksize; hashp->BSHIFT = __log2(hashp->BSIZE); |