diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c68ced329..d8d60b863 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2013-12-01 Christopher Faylor + + * dtable.cc (dtable::find_unused_handle): Break out of the right loop. + 2013-12-01 Christopher Faylor * dtable.cc (dtable::find_unused_handle): Fix off-by-one error. Always diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 485e79c5d..e97966b31 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; }