forked from kiwix/kiwix-tools
parent
6857e8d443
commit
4744f403c4
@ -0,0 +1,13 @@
|
||||
Index: src/liblzma/Makefile.am
|
||||
===================================================================
|
||||
--- src/liblzma/Makefile.am (revision 1)
|
||||
+++ src/liblzma/Makefile.am (working copy)
|
||||
@@ -24,7 +24,7 @@
|
||||
-I$(top_srcdir)/src/liblzma/delta \
|
||||
-I$(top_srcdir)/src/liblzma/simple \
|
||||
-I$(top_srcdir)/src/common
|
||||
-liblzma_la_LDFLAGS = -no-undefined -version-info 0:0:0
|
||||
+liblzma_la_LDFLAGS = -no-undefined -version-info 1:0:0
|
||||
|
||||
include $(srcdir)/common/Makefile.inc
|
||||
include $(srcdir)/check/Makefile.inc
|
@ -0,0 +1,62 @@
|
||||
commit 27414daadf5727e8ab942374b5ec1c8990122878
|
||||
Author: Lasse Collin <lasse.collin@tukaani.org>
|
||||
Date: Sat Aug 29 13:39:21 2009 +0300
|
||||
|
||||
Fix sysctl() usage.
|
||||
|
||||
This fixes build on *BSDs and Darwin.
|
||||
|
||||
Thanks to Jukka Salmi for the patches.
|
||||
Richard Koch reported the problem too.
|
||||
diff --git a/m4/lc_cpucores.m4 b/m4/lc_cpucores.m4
|
||||
index 2fae953..52f7c98 100644
|
||||
--- m4/lc_cpucores.m4
|
||||
+++ m4/lc_cpucores.m4
|
||||
@@ -43,7 +43,7 @@ main(void)
|
||||
int name[2] = { CTL_HW, HW_NCPU };
|
||||
int cpus;
|
||||
size_t cpus_size = sizeof(cpus);
|
||||
- sysctl(name, 2, &cpus, &cpus_size, NULL, NULL);
|
||||
+ sysctl(name, 2, &cpus, &cpus_size, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
diff --git a/m4/lc_physmem.m4 b/m4/lc_physmem.m4
|
||||
index 78be136..5d9581e 100644
|
||||
--- m4/lc_physmem.m4
|
||||
+++ m4/lc_physmem.m4
|
||||
@@ -45,7 +45,7 @@ main(void)
|
||||
int name[2] = { CTL_HW, HW_PHYSMEM };
|
||||
unsigned long mem;
|
||||
size_t mem_ptr_size = sizeof(mem);
|
||||
- sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL);
|
||||
+ sysctl(name, 2, &mem, &mem_ptr_size, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
diff --git a/src/common/cpucores.h b/src/common/cpucores.h
|
||||
index 704d8a2..330cd9c 100644
|
||||
--- src/common/cpucores.h
|
||||
+++ src/common/cpucores.h
|
||||
@@ -40,7 +40,7 @@ cpucores(void)
|
||||
int name[2] = { CTL_HW, HW_NCPU };
|
||||
int cpus;
|
||||
size_t cpus_size = sizeof(cpus);
|
||||
- if (!sysctl(name, &cpus, &cpus_size, NULL, NULL)
|
||||
+ if (!sysctl(name, 2, &cpus, &cpus_size, NULL, 0)
|
||||
&& cpus_size == sizeof(cpus) && cpus > 0)
|
||||
ret = (uint32_t)(cpus);
|
||||
#endif
|
||||
diff --git a/src/common/physmem.h b/src/common/physmem.h
|
||||
index 63482c6..0dc77e9 100644
|
||||
--- src/common/physmem.h
|
||||
+++ src/common/physmem.h
|
||||
@@ -104,7 +104,7 @@ physmem(void)
|
||||
uint64_t u64;
|
||||
} mem;
|
||||
size_t mem_ptr_size = sizeof(mem.u64);
|
||||
- if (!sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, NULL)) {
|
||||
+ if (!sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, 0)) {
|
||||
// IIRC, 64-bit "return value" is possible on some 64-bit
|
||||
// BSD systems even with HW_PHYSMEM (instead of HW_PHYSMEM64),
|
||||
// so support both.
|
Loading…
Reference in new issue