* dtable.cc (dtable::find_unused_handle): Break out of the right loop.
This commit is contained in:
		| @@ -1,3 +1,7 @@ | |||||||
|  | 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> | 2013-12-01  Christopher Faylor  <me.cygwin2013@cgf.cx> | ||||||
|  |  | ||||||
| 	* dtable.cc (dtable::find_unused_handle): Fix off-by-one error.  Always | 	* dtable.cc (dtable::find_unused_handle): Fix off-by-one error.  Always | ||||||
|   | |||||||
| @@ -230,14 +230,14 @@ dtable::find_unused_handle (size_t start) | |||||||
|   do |   do | ||||||
|     { |     { | ||||||
|       for (size_t i = start; i < size; i++) |       for (size_t i = start; i < size; i++) | ||||||
| 	/* See if open -- no need for overhead of not_open */ |  | ||||||
| 	if (fds[i] == NULL) | 	if (fds[i] == NULL) | ||||||
| 	  { | 	  { | ||||||
| 	    res = (int) i; | 	    res = (int) i; | ||||||
| 	    break; | 	    goto out; | ||||||
| 	  } | 	  } | ||||||
|     } |     } | ||||||
|   while (extend (extendby)); |   while (extend (extendby)); | ||||||
|  | out: | ||||||
|   return res; |   return res; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user