Comparing unsigned type for <= 0 does not make much sense, we should
really check the signed value returned by sysconf.
Resolves-coverity-id: 1324536
Signed-off-by: David Sterba <dsterba@suse.com>
if (compress_level > 0 || create == 0) {
if (num_threads == 0) {
- num_threads = sysconf(_SC_NPROCESSORS_ONLN);
- if (num_threads <= 0)
- num_threads = 1;
+ long tmp = sysconf(_SC_NPROCESSORS_ONLN);
+
+ if (tmp <= 0)
+ tmp = 1;
+ num_threads = tmp;
}
} else {
num_threads = 0;