Skip to content

Commit 6579134

Browse files
AZero13millert
authored andcommitted
Debug uses the wrong fd
It should print it out before it is updated.
1 parent 2189067 commit 6579134

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/preserve_fds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ closefrom_except(int startfd, struct preserved_fd_list *pfds)
100100
/* NOTE: still need to adjust lastfd below with unchanged lowfd. */
101101
} else if (fd < pfd->highfd) {
102102
sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO,
103-
"dup %d -> %d", pfd->highfd, pfd->lowfd);
104-
sudo_debug_update_fd(pfd->highfd, pfd->lowfd);
103+
"dup %d -> %d", pfd->highfd, fd);
104+
sudo_debug_update_fd(pfd->highfd, fd);
105105
pfd->lowfd = fd;
106106
fd = pfd->highfd;
107107
}

0 commit comments

Comments
 (0)