From 1a94d1f0f7e1403fd76ff09fbdb0d79c766d1a5c Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 25 Sep 2016 03:32:55 +0200 Subject: runserver: silent a few warnings --- src/blogc-runserver/httpd.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/blogc-runserver/httpd.c b/src/blogc-runserver/httpd.c index c659580..c725c1f 100644 --- a/src/blogc-runserver/httpd.c +++ b/src/blogc-runserver/httpd.c @@ -41,7 +41,9 @@ error(int socket, int status_code, const char *error) "Connection: close\r\n" "\r\n" "

%s

\n", status_code, error, error); - write(socket, str, strlen(str)); + if (write(socket, str, strlen(str)) == -1) { + // do nothing, just avoid warnig + } free(str); } @@ -138,7 +140,9 @@ handle_request(void *arg) "Location: %s/\r\n" "Connection: close\r\n" "\r\n", path); - write(client_socket, tmp, strlen(tmp)); + if (write(client_socket, tmp, strlen(tmp)) == -1) { + // do nothing, just avoid warnig + } free(tmp); goto point3; } @@ -158,10 +162,14 @@ handle_request(void *arg) "Content-Length: %d\r\n" "Connection: close\r\n" "\r\n", br_mime_guess_content_type(real_path), len); - write(client_socket, out, strlen(out)); + if (write(client_socket, out, strlen(out)) == -1) { + // do nothing, just avoid warnig + } free(out); - write(client_socket, contents, len); + if (write(client_socket, contents, len) == -1) { + // do nothing, just avoid warnig + } point3: free(real_root); -- cgit v1.2.3-18-g5258