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:
authorChristopher Faylor <me@cgf.cx>2000-08-04 08:04:46 +0400
committerChristopher Faylor <me@cgf.cx>2000-08-04 08:04:46 +0400
commit91892f50d9f2582c92ebe833fd39b65252ca3eae (patch)
tree0e8e84acbadc2b2ea57bafb606db642f0f083f1a /winsup/cygwin/dtable.cc
parente5dd88116a080a254c30a8949ddc0b44063e719b (diff)
* hinfo.cc (hinfo::find_unused_handle): Just check for table entry == NULL
since we are already bounds checked by default. * thread.cc (ResourceLocks::Lock): Streamline this function since it is called a lot. (ReleaseResourceLock): Ditto.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index ad6ec5dc7..72ee96f67 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -125,12 +125,13 @@ hinfo::not_open (int fd)
int
hinfo::find_unused_handle (int start)
{
- AssertResourceOwner(LOCK_FD_LIST,READ_LOCK);
+ AssertResourceOwner(LOCK_FD_LIST, READ_LOCK);
do
{
for (int i = start; i < (int) size; i++)
- if (not_open (i))
+ /* See if open -- no need for overhead of not_open */
+ if (fds[i] == NULL)
return i;
}
while (extend (NOFILE_INCR));