From b0ab54d7597ba1382656dd303d946087dd3e6d27 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 21:55:13 +0000 Subject: Apply patch memcached-low-conns-segfault.patch patch_name: memcached-low-conns-segfault.patch present_in_specfile: true location_in_specfile: 4 --- diff --git a/memcached.c b/memcached.c index 3916a8c..70a9d13 100644 --- a/memcached.c +++ b/memcached.c @@ -387,7 +387,11 @@ static void *conn_timeout_thread(void *arg) { char buf[TIMEOUT_MSG_SIZE]; rel_time_t oldest_last_cmd; int sleep_time; - useconds_t timeslice = 1000000 / (max_fds / CONNS_PER_SLICE); + int sleep_slice = max_fds / CONNS_PER_SLICE; + if (sleep_slice == 0) + sleep_slice = CONNS_PER_SLICE; + + useconds_t timeslice = 1000000 / sleep_slice; while(do_run_conn_timeout_thread) { if (settings.verbose > 2)