fnet.c

Simple C networking library
git clone git://git.finwo.net/lib/fnet.c
Log | Files | Refs | README

commit 3748ecc088d23ae613b08a9658646557396f075c
parent 61e0c9f28daf7903b7ce5839a669905f4bc3dcb4
Author: Yersa Nordman <yersa@finwo.nl>
Date:   Mon, 23 Oct 2023 21:16:17 +0200

Use 'recv' instead of 'read'

Diffstat:
Msrc/fnet.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fnet.c b/src/fnet.c @@ -456,7 +456,7 @@ FNET_RETURNCODE fnet_process(const struct fnet_t *connection) { rbuf->data = malloc(BUFSIZ); rbuf->cap = BUFSIZ; for ( i = 0 ; i < conn->nfds ; i++ ) { - n = read(conn->fds[i], rbuf->data, rbuf->cap); + n = recv(conn->fds[i], rbuf->data, rbuf->cap, 0); if (n < 0) { if (errno == EAGAIN) continue; buf_clear(rbuf);