Skip to content

Commit

Permalink
Unify common code
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Jun 20, 2022
1 parent 6789183 commit 9abad42
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ static void slave(char *slave_path) {
die("%s: %m\n", unix_socket_name);
listen(s_listen, 1);
fprintf(out, "LISTEN %s\n", unix_socket_name);
fflush(out);
} else {
struct sockaddr_in sockaddr;
socklen_t sockaddr_len = sizeof(sockaddr);
Expand All @@ -705,8 +704,8 @@ static void slave(char *slave_path) {
if (res == -1)
die("listen: %m\n");
fprintf(out, "LISTEN %d\n", ntohs(sockaddr.sin_port));
fflush(out);
}
fflush(out);
s_data = accept(s_listen, NULL, NULL);
if (s_data == -1)
die("accept: %m\n");
Expand Down

0 comments on commit 9abad42

Please sign in to comment.