]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Return 0 when detecting the amount of memory fails
authorMatthew Finkel <Matthew.Finkel@gmail.com>
Mon, 9 Feb 2015 01:58:22 +0000 (01:58 +0000)
committerMatthew Finkel <Matthew.Finkel@gmail.com>
Mon, 9 Feb 2015 02:06:18 +0000 (02:06 +0000)
Fixes bug 14802;  bugfix on 0.2.5.4-alpha.

changes/bug14802 [new file with mode: 0644]
src/common/compat.c

diff --git a/changes/bug14802 b/changes/bug14802
new file mode 100644 (file)
index 0000000..fc7cfd1
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfix:
+    - Make an educated guess about how much memory the system has when our
+      detection functionality fails on some operating system.  Fixes bug 14802;
+      bugfix on 0.2.5.4-alpha.
index e25ecc462d713975efcc1fc1f9d5888520a4d1fe..3eda1ca00dea3b9391be39d89fb4b361a8f8bec8 100644 (file)
@@ -3517,7 +3517,7 @@ get_total_system_memory_impl(void)
   size_t len = sizeof(memsize);
   int mib[2] = {CTL_HW, HW_USERMEM};
   if (sysctl(mib,2,&memsize,&len,NULL,0))
-    return -1;
+    return 0;
 
   return memsize;