about summary refs log tree commit diff stats
path: root/src/wrapped
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapped')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 2537a68b..a257cc07 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -1297,6 +1297,12 @@ void grabNCpu() {
         if(!nCPU) nCPU=1;
     }
 }
+int getNCpu()
+{
+    if(!nCPU)
+        grabNCpu();
+    return nCPU;
+}
 void CreateCPUInfoFile(int fd)
 {
     size_t dummy;
@@ -1310,9 +1316,7 @@ void CreateCPUInfoFile(int fd)
             freq = r/1000.;
         fclose(f);
     }
-    if(!nCPU)
-        grabNCpu();
-    int n = nCPU;
+    int n = getNCpu();
     // generate fake CPUINFO
     int gigahertz=(freq>=1000.);
     #define P \