git » nmdb » commit 46515f4

nmdb: Use the appropriate type for storing send() return value

author Alberto Bertogli
2010-10-06 16:41:11 UTC
committer Alberto Bertogli
2010-10-06 16:41:11 UTC
parent 075f69192a36e39ebb3be1b6a624fab0b4c41ed5

nmdb: Use the appropriate type for storing send() return value

Caught by the clang-analyzer tool.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

nmdb/tcp.c +3 -2

diff --git a/nmdb/tcp.c b/nmdb/tcp.c
index b435756..9591145 100644
--- a/nmdb/tcp.c
+++ b/nmdb/tcp.c
@@ -77,6 +77,7 @@ static void init_req(struct tcp_socket *tcpsock)
 static void rep_send_error(const struct req_info *req, const unsigned int code)
 {
 	uint32_t l, r, c;
+	ssize_t rv;
 	unsigned char minibuf[4 * 4];
 
 	if (settings.passive)
@@ -92,9 +93,9 @@ static void rep_send_error(const struct req_info *req, const unsigned int code)
 	memcpy(minibuf + 12, &c, 4);
 
 	/* If this send fails, there's nothing to be done */
-	r = send(req->fd, minibuf, 4 * 4, 0);
+	rv = send(req->fd, minibuf, 4 * 4, 0);
 
-	if (r < 0) {
+	if (rv < 0) {
 		errlog("rep_send_error() failed");
 	}
 }