diff options
author | bloodstalker <thabogre@gmail.com> | 2017-03-11 17:57:30 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2017-03-11 17:57:30 +0000 |
commit | 7273d3846898dbf867e251a5e94a52e20a71b78e (patch) | |
tree | 48bd99eb785549b2efdef4a6d17e6a59523780cf /daemon/daemon_aux.c | |
parent | fixing some issues (diff) | |
download | mutator-7273d3846898dbf867e251a5e94a52e20a71b78e.tar.gz mutator-7273d3846898dbf867e251a5e94a52e20a71b78e.zip |
fixing issues
Diffstat (limited to '')
-rw-r--r-- | daemon/daemon_aux.c | 5 |
1 files changed, 3 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; } /**********************************************************************************************************************/ |