Skip to content

Commit

Permalink
Actually, since the close calls shouldn't fail (now that listener
Browse files Browse the repository at this point in the history
is properly set to -1 on close), we don't really need to play the
save-errno game after all.
  • Loading branch information
Wayne Davison committed Sep 16, 2004
1 parent a7a1cc2 commit eb8ffa9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ static int socketpair_tcp(int fd[2])
struct sockaddr_in sock;
struct sockaddr_in sock2;
socklen_t socklen = sizeof sock;
int errno_save, connect_done = 0;
int connect_done = 0;

fd[0] = fd[1] = listener = -1;

Expand Down Expand Up @@ -741,14 +741,12 @@ static int socketpair_tcp(int fd[2])
return 0;

failed:
errno_save = errno;
if (fd[0] != -1)
close(fd[0]);
if (fd[1] != -1)
close(fd[1]);
if (listener != -1)
close(listener);
errno = errno_save;
return -1;
}

Expand Down

0 comments on commit eb8ffa9

Please sign in to comment.