~angelsl/ubuntu/wily/gcc-5/mips-cross

« back to all changes in this revision

Viewing changes to debian/patches/boehm-gc-getnprocs.diff

  • Committer: angelsl
  • Date: 2015-10-30 03:30:35 UTC
  • Revision ID: angelsl-20151030033035-rmug41zm8hyjgisg
Original import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: boehm-gc/pthread_support.c (GC_get_nprocs): Use sysconf as fallback.
 
2
 
 
3
---
 
4
 boehm-gc/pthread_support.c |    3 ++-
 
5
 1 files changed, 2 insertions(+), 1 deletions(-)
 
6
 
 
7
Index: b/src/boehm-gc/pthread_support.c
 
8
===================================================================
 
9
--- a/src/boehm-gc/pthread_support.c
 
10
+++ b/src/boehm-gc/pthread_support.c
 
11
@@ -724,7 +724,8 @@ int GC_get_nprocs()
 
12
     f = open("/proc/stat", O_RDONLY);
 
13
     if (f < 0 || (len = STAT_READ(f, stat_buf, STAT_BUF_SIZE)) < 100) {
 
14
        WARN("Couldn't read /proc/stat\n", 0);
 
15
-       return -1;
 
16
+       /* Fallback to sysconf after the warning */
 
17
+       return sysconf(_SC_NPROCESSORS_ONLN);
 
18
     }
 
19
     for (i = 0; i < len - 100; ++i) {
 
20
         if (stat_buf[i] == '\n' && stat_buf[i+1] == 'c'