From: Guus Sliepen Date: Thu, 2 Jun 2011 22:34:30 +0000 (+0200) Subject: Use send() when writing to sockets, and the return type is ssize_t. X-Git-Tag: release-1.1pre1~15 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=3ade33bfac11715190ed3e6cc3589d1a738ce257 Use send() when writing to sockets, and the return type is ssize_t. --- 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);