From 24d2ea04a28579fac4ab08b3855c2240e94b71fd Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Tue, 11 Sep 2018 15:17:27 -0400 Subject: [PATCH] Fix minor type thing --- server/socket_server.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/socket_server.c b/server/socket_server.c index a56e58a..0921a64 100644 --- a/server/socket_server.c +++ b/server/socket_server.c @@ -269,12 +269,12 @@ enum socket_result serve_one_request(int sock_fd) { } // Attempt to read the file and return it. struct requested_file file = {}; - int file_result = get_file_from_uri(parsed_request_line.uri, &file); - if (file_result != RESULT_FILE_OK) { + enum file_result file_get_result = get_file_from_uri(parsed_request_line.uri, &file); + if (file_get_result != RESULT_FILE_OK) { int send_result = 0; - if (file_result == RESULT_NOT_FILE || (file_result == RESULT_IO_ERROR && errno == ENOENT)) { + if (file_get_result == RESULT_NOT_FILE || (file_get_result == RESULT_IO_ERROR && errno == ENOENT)) { send_result = send_headers(404, client_fd, -1); - } else if (file_result == RESULT_IO_ERROR && errno == EACCES) { + } else if (file_get_result == RESULT_IO_ERROR && errno == EACCES) { send_result = send_headers(403, client_fd, -1); } else { free_request_line_items(&parsed_request_line); @@ -298,7 +298,7 @@ enum socket_result serve_one_request(int sock_fd) { } free_request_line_items(&parsed_request_line); free_request_items(message); - if (file_result == RESULT_FILE_OK) { + if (file_get_result == RESULT_FILE_OK) { fclose(file.file); }