Skip to content

Commit

Permalink
Address compiler warning in CI
Browse files Browse the repository at this point in the history
warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  • Loading branch information
DimitriPapadopoulos committed Feb 10, 2025
1 parent b2bedaf commit 27517e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ static void send_status_response(int socket, const char *userMessage)

// Using two separate writes here to make the code not more complicated assembling
// the buffers.
write(socket, replyHeaderBuffer, strlen(replyHeaderBuffer));
write(socket, replyBodyBuffer, strlen(replyBodyBuffer));
if (write(socket, replyHeaderBuffer, strlen(replyHeaderBuffer)) < 0)
log_warn("Failed to write: %s\n", strerror(errno));
if (write(socket, replyBodyBuffer, strlen(replyBodyBuffer)) < 0)
log_warn("Failed to write: %s\n", strerror(errno));

end:
free(replyBodyBuffer);
Expand Down

0 comments on commit 27517e0

Please sign in to comment.