Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-09-20 01:28:52 +0400
committerJeff Johnston <jjohnstn@redhat.com>2002-09-20 01:28:52 +0400
commit50558bf3bdb5e2fc2454f38316af1f06f82f9a5d (patch)
tree06876f77aa28773abc0dfae1f21adf94fa5f3d26 /newlib/libc/search
parent0688e43db7cdf256bd7f38c9b0524cf71032ecf9 (diff)
2002-09-19 Jeff Johnston <jjohnstn@redhat.com>
* libc/posix/opendir.c (opendir): Change code to check for HAVE_FCNTL before calling fcntl. * libc/search/hash.c (hash_open): Ditto. * libc/search/hash_page.c (open_tmp): Ditto. * libc/reent/Makefile.am: Add fcntlr.c. * libc/reent/Makefile.in: Regenerated. * libc/reent/fcntlr.c: New file. * libc/stdio/fdopen.c (_fdopen_r): Change to call _fcntl_r instead of _fcntl when HAVE_FCNTL flag is set. * libc/syscalls/sysfcntl.c (fcntl): Check for HAVE_FCNTL flag to see if _fcntl or _fcntl_r should be called. If flag is not set, default to ENOSYS stub.
Diffstat (limited to 'newlib/libc/search')
-rw-r--r--newlib/libc/search/hash.c2
-rw-r--r--newlib/libc/search/hash_page.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/search/hash.c b/newlib/libc/search/hash.c
index 3aa3eb7ea..10b4ded47 100644
--- a/newlib/libc/search/hash.c
+++ b/newlib/libc/search/hash.c
@@ -143,7 +143,9 @@ __hash_open(file, flags, mode, info, dflags)
fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
new_table = 1;
+#ifdef HAVE_FCNTL
(void)fcntl(hashp->fp, F_SETFD, 1);
+#endif
}
if (new_table) {
if (!(hashp = init_hash(hashp, file, (HASHINFO *)info)))
diff --git a/newlib/libc/search/hash_page.c b/newlib/libc/search/hash_page.c
index cffb20aa3..68ab9db17 100644
--- a/newlib/libc/search/hash_page.c
+++ b/newlib/libc/search/hash_page.c
@@ -869,7 +869,9 @@ open_temp(hashp)
(void)sigprocmask(SIG_BLOCK, &set, &oset);
if ((hashp->fp = mkstemp(namestr)) != -1) {
(void)unlink(namestr);
+#ifdef HAVE_FCNTL
(void)fcntl(hashp->fp, F_SETFD, 1);
+#endif
}
(void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
return (hashp->fp != -1 ? 0 : -1);