* winsup.api/ltp/dup03.c (cleanup): Fix longstanding off-by-one error when
setting array element to -1.
This commit is contained in:
parent
4989ff286d
commit
4e8e54543e
|
@ -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>
|
||||
|
||||
* winsup.api/pthread/cancel2.c: Use explicit initializer for mutex.
|
||||
|
|
|
@ -271,8 +271,8 @@ cleanup()
|
|||
|
||||
/* close the open file we've been dup'ing */
|
||||
if (Fd) {
|
||||
for (; Nfds >0 ; Nfds--) {
|
||||
if (close(Fd[Nfds-1]) == -1) {
|
||||
while (Nfds-- >0) {
|
||||
if (close(Fd[Nfds]) == -1) {
|
||||
tst_resm(TWARN, "close(%s) Failed, errno=%d : %s",
|
||||
Fname, errno, strerror(errno));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue