Closed EricYT closed 5 years ago
The function synopsis of dup2 is int dup2(int oldfd, int newfd);. So the first argument should be oldfd, not the target.
int dup2(int oldfd, int newfd);
The function synopsis of dup2 is
int dup2(int oldfd, int newfd);
. So the first argument should be oldfd, not the target.