xbps_array_foreach_cb_multi: handle the case of sysconf returning 0.
This commit is contained in:
parent
93b50bc4dc
commit
a9482027b2
@ -101,7 +101,7 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
maxthreads = (int)sysconf(_SC_NPROCESSORS_ONLN);
|
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);
|
return xbps_array_foreach_cb(xhp, array, dict, fn, arg);
|
||||||
|
|
||||||
thd = calloc(maxthreads, sizeof(*thd));
|
thd = calloc(maxthreads, sizeof(*thd));
|
||||||
|
Loading…
Reference in New Issue
Block a user