The 'new->fds' array is not yet initialized at the point where the check
if the FD is occupied happens so the error would always report that FD
'0' is in use. Use 'new->testfds' instead.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
new->testfds[i] = va_arg(argptr, unsigned int);
if (fcntl(new->testfds[i], F_GETFD) != -1) {
- fprintf(stderr, "fd '%d' is already in use\n", new->fds[i]);
+ fprintf(stderr, "fd '%d' is already in use\n", new->testfds[i]);
abort();
}