From faebe1d04303704c9fc4b2a8333f30bf55c3d73c Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 15 Oct 2023 16:02:09 +0900 Subject: [PATCH] changed dev_sck_sendfile_stream to handle return value of 0 by sendfile as if it's EWOULDBLOCK --- lib/err.c | 1 - lib/hio-cfg.h.in | 3 +-- lib/sck.c | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/err.c b/lib/err.c index 8c721e6..12dba7c 100644 --- a/lib/err.c +++ b/lib/err.c @@ -404,4 +404,3 @@ void hio_seterrufmtwithsyserr (hio_t* hio, int syserr_type, int syserr_code, con } }*/ } - diff --git a/lib/hio-cfg.h.in b/lib/hio-cfg.h.in index 073e8c0..1f16949 100644 --- a/lib/hio-cfg.h.in +++ b/lib/hio-cfg.h.in @@ -30,8 +30,7 @@ /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */ #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA -/* Define to 1 if you have the header file, and it defines `DIR'. - */ +/* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the `dirfd' function. */ diff --git a/lib/sck.c b/lib/sck.c index 5941a7c..321968b 100644 --- a/lib/sck.c +++ b/lib/sck.c @@ -1122,6 +1122,7 @@ static int dev_sck_sendfile_stream (hio_dev_t* dev, hio_syshnd_t in_fd, hio_foff return -1; } *len = x; + if (x == 0) return 0; /* treat it like EWOULDBLOCK? */ #else hio_seterrnum (hio, HIO_ENOIMPL); return -1;