SHA256
1
0
forked from pool/coreutils
coreutils/coreutils-8.9-singlethreaded-sort.patch
Philipp Thomas 7778de0576 Accepting request 135267 from home:froh:branches:Base:System
fix multithreading patch for sort(1) to respect OMP_NUM_THREADS again.
the other, "pending" request, #114813, was rejected by aj already

OBS-URL: https://build.opensuse.org/request/show/135267
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=158
2012-09-21 15:56:26 +00:00

18 lines
531 B
Diff

Index: src/sort.c
===================================================================
--- src/sort.c.orig
+++ src/sort.c
@@ -5288,7 +5288,11 @@ main (int argc, char **argv)
{
if (!nthreads)
{
- unsigned long int np = num_processors (NPROC_CURRENT_OVERRIDABLE);
+ unsigned long int np;
+ if (getenv("OMP_NUM_THREADS"))
+ np = num_processors (NPROC_CURRENT_OVERRIDABLE);
+ else
+ np = 1;
nthreads = MIN (np, DEFAULT_MAX_THREADS);
}