gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 02/02: mhd_send: round up readahead size on FreeBSD


From: gnunet
Subject: [libmicrohttpd] 02/02: mhd_send: round up readahead size on FreeBSD
Date: Thu, 15 Oct 2020 16:11:53 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 1777068bd81603228f0c7e3e20005769aeba838e
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Oct 15 17:04:02 2020 +0300

    mhd_send: round up readahead size on FreeBSD
---
 src/microhttpd/mhd_send.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 987a694b..50fa5483 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -84,7 +84,7 @@ MHD_send_init_static_vars_ (void)
  * SF_FLAGS defined only on FreeBSD 11 and later. */
 #ifdef SF_FLAGS
   long sys_page_size = sysconf (_SC_PAGESIZE);
-  if (0 > sys_page_size)
+  if (0 >= sys_page_size)
   {   /* Failed to get page size. */
     freebsd_sendfile_flags_ = SF_NODISKIO;
     freebsd_sendfile_flags_thd_p_c_ = SF_NODISKIO;
@@ -92,10 +92,11 @@ MHD_send_init_static_vars_ (void)
   else
   {
     freebsd_sendfile_flags_ =
-      SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_ / sys_page_size), SF_NODISKIO);
+      SF_FLAGS ((uint16_t) ((MHD_SENFILE_CHUNK_ + sys_page_size - 1)
+                            / sys_page_size), SF_NODISKIO);
     freebsd_sendfile_flags_thd_p_c_ =
-      SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_THR_P_C_ / sys_page_size),
-                SF_NODISKIO);
+      SF_FLAGS ((uint16_t) ((MHD_SENFILE_CHUNK_THR_P_C_ + sys_page_size - 1)
+                            / sys_page_size), SF_NODISKIO);
   }
 #endif /* SF_FLAGS */
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]