From 3ade33bfac11715190ed3e6cc3589d1a738ce257 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 3 Jun 2011 00:34:30 +0200 Subject: [PATCH] Use send() when writing to sockets, and the return type is ssize_t. --- src/net_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net_socket.c b/src/net_socket.c index 80f37a45..d470fef5 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -454,7 +454,7 @@ static void handle_meta_write(int sock, short events, void *data) { connection_t *c = data; - size_t outlen = write(c->socket, c->outbuf.data + c->outbuf.offset, c->outbuf.len - c->outbuf.offset); + ssize_t outlen = send(c->socket, c->outbuf.data + c->outbuf.offset, c->outbuf.len - c->outbuf.offset, 0); if(outlen <= 0) { logger(LOG_ERR, "Onoes, outlen = %zd (%s)", outlen, strerror(errno)); terminate_connection(c, c->status.active); -- 2.39.5