From a9482027b20f72ec361e38155b89038a82196a7f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 26 Nov 2015 07:18:14 +0100 Subject: [PATCH] xbps_array_foreach_cb_multi: handle the case of sysconf returning 0. --- lib/plist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plist.c b/lib/plist.c index ef18b06c..0637e9f0 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -101,7 +101,7 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp, return 0; maxthreads = (int)sysconf(_SC_NPROCESSORS_ONLN); - if (maxthreads < 0 || maxthreads == 1) /* use single threaded routine */ + if (maxthreads <= 0 || maxthreads == 1) /* use single threaded routine */ return xbps_array_foreach_cb(xhp, array, dict, fn, arg); thd = calloc(maxthreads, sizeof(*thd));