commit 28a67e3db49a25040e80e0d14bb38b8e64ae71b0 parent 18581f1694f1249c3862358e126aebb266fc448a Author: Evgeny Grin (Karlson2k) <k2k@narod.ru> Date: Wed, 27 Apr 2022 21:04:24 +0300 mhd_send: added safe default value if sysconf() is broken Diffstat:
| M | src/microhttpd/mhd_send.c | | | 8 | ++++++-- |
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c @@ -126,10 +126,14 @@ iov_max_init_ (void) long res = sysconf (_SC_IOV_MAX); if (res >= 0) mhd_iov_max_ = (unsigned long) res; -#if defined(IOV_MAX) else + { +#if defined(IOV_MAX) mhd_iov_max_ = IOV_MAX; -#endif /* IOV_MAX */ +#else /* ! IOV_MAX */ + mhd_iov_max_ = 8; /* Should be the safe limit */ +#endif /* ! IOV_MAX */ + } }