diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/daemon_aux.c | 5 | ||||
-rw-r--r-- | daemon/mutatorclient.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/daemon/daemon_aux.c b/daemon/daemon_aux.c index 248df08..6057f2a 100644 --- a/daemon/daemon_aux.c +++ b/daemon/daemon_aux.c @@ -56,6 +56,7 @@ int mutator_server(FILE* log_file) server.sin_family = AF_INET; server.sin_addr.s_addr = INADDR_ANY; server.sin_port = htons(8888); + memset(server.sin_zero, 0, 8); /*Bind*/ if (bind(socket_desc, (struct sockaddr*)&server, sizeof(server)) < 0) @@ -142,8 +143,6 @@ int mutator_server(FILE* log_file) fprintf(log_file, "%s", "client disconnected\n"); fflush(stdout); fprintf(log_file, "%s", "closing log file\n"); - close(client_sock); - close(socket_desc); } else if (read_size == -1) { @@ -154,6 +153,8 @@ int mutator_server(FILE* log_file) /*intentionally left blank*/ } + close(client_sock); + close(socket_desc); return 0; } /**********************************************************************************************************************/ diff --git a/daemon/mutatorclient.c b/daemon/mutatorclient.c index d65eef5..2b61d96 100644 --- a/daemon/mutatorclient.c +++ b/daemon/mutatorclient.c @@ -56,6 +56,7 @@ int main(int argc, char *argv[]) server.sin_addr.s_addr = inet_addr("127.0.0.1"); server.sin_family = AF_INET; server.sin_port = htons(8888); + memset(server.sin_zero, 0, 8); /*connect to remote server*/ if (connect(sock, (struct sockaddr*)&server, sizeof(server)) < 0) |