From 26d121d7ece914511ad375c6a4bcdd2b52f7fea4 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sat, 11 Mar 2017 20:50:45 +0330 Subject: fixing some issues --- daemon/daemon_aux.c | 2 ++ daemon/mutatord.c | 2 ++ daemon/mutatorserver.c | 1 + 3 files changed, 5 insertions(+) (limited to 'daemon') diff --git a/daemon/daemon_aux.c b/daemon/daemon_aux.c index 86e57ee..248df08 100644 --- a/daemon/daemon_aux.c +++ b/daemon/daemon_aux.c @@ -142,6 +142,8 @@ 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) { diff --git a/daemon/mutatord.c b/daemon/mutatord.c index 7d4a244..a0496d3 100644 --- a/daemon/mutatord.c +++ b/daemon/mutatord.c @@ -141,8 +141,10 @@ int main(void) }while(0); /*@DEVI-these obviously will never run. theyre just a reminder that i need to handle the gracefull shutdown*/ +#if 0 fclose(mut_log); exit(EXIT_SUCCESS); +#endif } /*last line intentionally left blank*/ diff --git a/daemon/mutatorserver.c b/daemon/mutatorserver.c index 99f86c1..5965a69 100644 --- a/daemon/mutatorserver.c +++ b/daemon/mutatorserver.c @@ -56,6 +56,7 @@ int main (int argc, char *argv[]) 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) -- cgit v1.2.3