diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-25 03:32:55 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-25 03:32:55 +0200 |
commit | 1a94d1f0f7e1403fd76ff09fbdb0d79c766d1a5c (patch) | |
tree | 4f9389159798a1509129d6ab4b4532cec2b75a7b /src | |
parent | 104c28139d8ca15ef17aa5559d5eef2aa0081179 (diff) | |
download | blogc-1a94d1f0f7e1403fd76ff09fbdb0d79c766d1a5c.tar.gz blogc-1a94d1f0f7e1403fd76ff09fbdb0d79c766d1a5c.tar.bz2 blogc-1a94d1f0f7e1403fd76ff09fbdb0d79c766d1a5c.zip |
runserver: silent a few warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/blogc-runserver/httpd.c | 16 |
1 files 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" "<h1>%s</h1>\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); |