* winsup.api/ltp/dup03.c (cleanup): Fix longstanding off-by-one error when
setting array element to -1.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2005-12-11  Christopher Faylor  <cgf@timesys.com> | ||||||
|  |  | ||||||
|  | 	* winsup.api/ltp/dup03.c (cleanup): Fix longstanding off-by-one error | ||||||
|  | 	when setting array element to -1. | ||||||
|  |  | ||||||
| 2005-06-11  Christopher Faylor  <cgf@timesys.com> | 2005-06-11  Christopher Faylor  <cgf@timesys.com> | ||||||
|  |  | ||||||
| 	* winsup.api/pthread/cancel2.c: Use explicit initializer for mutex. | 	* winsup.api/pthread/cancel2.c: Use explicit initializer for mutex. | ||||||
|   | |||||||
| @@ -271,8 +271,8 @@ cleanup() | |||||||
|  |  | ||||||
|     /* close the open file we've been dup'ing */ |     /* close the open file we've been dup'ing */ | ||||||
|     if (Fd) { |     if (Fd) { | ||||||
|     	for (; Nfds >0 ; Nfds--) { |     	while (Nfds-- >0) { | ||||||
|     	    if (close(Fd[Nfds-1]) == -1) { |     	    if (close(Fd[Nfds]) == -1) { | ||||||
| 		tst_resm(TWARN, "close(%s) Failed, errno=%d : %s", | 		tst_resm(TWARN, "close(%s) Failed, errno=%d : %s", | ||||||
| 				Fname, errno, strerror(errno)); | 				Fname, errno, strerror(errno)); | ||||||
| 	    } | 	    } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user