aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-12-01 19:17:56 +0000
committerChristopher Faylor <me@cgf.cx>2013-12-01 19:17:56 +0000
commit9262c055370b4d22420b3a08cdff91d24abc67dd (patch)
tree2c97b48a6b051be5c0ab949158d7582ac7f9c044 /winsup/cygwin
parentf456b9f6f8efcb1e7472d31860b5815ccd614aa4 (diff)
downloadnewlib-9262c055370b4d22420b3a08cdff91d24abc67dd.zip
newlib-9262c055370b4d22420b3a08cdff91d24abc67dd.tar.gz
newlib-9262c055370b4d22420b3a08cdff91d24abc67dd.tar.bz2
* dtable.cc (dtable::find_unused_handle): Break out of the right loop.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/dtable.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c68ced3..d8d60b8 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2013-12-01 Christopher Faylor <me.cygwin2013@cgf.cx>
+ * dtable.cc (dtable::find_unused_handle): Break out of the right loop.
+
+2013-12-01 Christopher Faylor <me.cygwin2013@cgf.cx>
+
* dtable.cc (dtable::find_unused_handle): Fix off-by-one error. Always
exit through the bottom.
(cygwin_attach_handle_to_fd): Make sure that fd tab is locked for the
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 485e79c..e97966b 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -230,14 +230,14 @@ dtable::find_unused_handle (size_t start)
do
{
for (size_t i = start; i < size; i++)
- /* See if open -- no need for overhead of not_open */
if (fds[i] == NULL)
{
res = (int) i;
- break;
+ goto out;
}
}
while (extend (extendby));
+out:
return res;
}