From 438c8600e03650ec822afb89dfe1d9c8b963c236 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 17 Nov 2020 15:00:44 -0600 Subject: add comment --- P3/server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'P3') diff --git a/P3/server.c b/P3/server.c index 2353ed2..31c4db0 100644 --- a/P3/server.c +++ b/P3/server.c @@ -258,7 +258,7 @@ int main(int argc, char **argv) { if (sigemptyset(&act.sa_mask) == -1 || sigaction(SIGINT, &act, NULL) == -1) { perror("SIGINT Handler Error"); - return -1; + return -2; } // Open log file to make it exist FILE* logfile = fopen("webserver_log", "w"); @@ -267,7 +267,7 @@ int main(int argc, char **argv) { // Change the current working directory to server root directory if (chdir(path) == -1) { perror("Directory Change error"); - return -1; + return -2; } // Initialize cache (extra credit B) cache_entry_t *dynQ; @@ -280,6 +280,7 @@ int main(int argc, char **argv) { } } + //Make sure threads are all detached pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); -- cgit v1.2.3