1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
|
This is an autogenerated patch header for a single-debian-patch file. The
delta against upstream is either kept as a single patch, or maintained
in some VCS, and exported as a single patch instead of more manageable
atomic patches.
--- vmemcache-0.8.1.orig/benchmarks/bench_simul.c
+++ vmemcache-0.8.1/benchmarks/bench_simul.c
@@ -708,7 +708,11 @@ main(int argc, const char **argv)
}
lotta_zeroes = mmap(NULL, max_size, PROT_READ,
- MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS
+#ifdef MAP_POPULATE
+ | MAP_POPULATE
+#endif
+ , -1, 0);
if (!lotta_zeroes) {
UT_FATAL("couldn't grab a zero buffer: mmap failed: %s",
strerror(errno));
--- vmemcache-0.8.1.orig/src/file.h
+++ vmemcache-0.8.1/src/file.h
@@ -23,6 +23,10 @@ extern "C" {
#define NAME_MAX _MAX_FNAME
#endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
struct file_info {
char filename[NAME_MAX + 1];
int is_dir;
--- vmemcache-0.8.1.orig/src/os_thread.h
+++ vmemcache-0.8.1/src/os_thread.h
@@ -40,54 +40,25 @@
#include <stdint.h>
#include <time.h>
+#include <pthread.h>
+#include <semaphore.h>
#ifdef __cplusplus
extern "C" {
#endif
-typedef union {
- long long align;
- char padding[44]; /* linux: 40 windows: 44 */
-} os_mutex_t;
-
-typedef union {
- long long align;
- char padding[56]; /* linux: 56 windows: 13 */
-} os_rwlock_t;
-
-typedef union {
- long long align;
- char padding[48]; /* linux: 48 windows: 12 */
-} os_cond_t;
-
-typedef union {
- long long align;
- char padding[32]; /* linux: 8 windows: 32 */
-} os_thread_t;
-
-typedef union {
- long long align; /* linux: long windows: 8 FreeBSD: 12 */
- char padding[16]; /* 16 to be safe */
-} os_once_t;
+typedef pthread_mutex_t os_mutex_t;
+typedef pthread_rwlock_t os_rwlock_t;
+typedef pthread_cond_t os_cond_t;
+typedef pthread_t os_thread_t;
+typedef pthread_once_t os_once_t;
-#define OS_ONCE_INIT { .padding = {0} }
+#define OS_ONCE_INIT {0}
typedef unsigned os_tls_key_t;
-
-typedef union {
- long long align;
- char padding[56]; /* linux: 56 windows: 8 */
-} os_semaphore_t;
-
-typedef union {
- long long align;
- char padding[56]; /* linux: 56 windows: 8 */
-} os_thread_attr_t;
-
-typedef union {
- long long align;
- char padding[512];
-} os_cpu_set_t;
+typedef sem_t os_semaphore_t;
+typedef pthread_attr_t os_thread_attr_t;
+typedef cpu_set_t os_cpu_set_t;
#ifdef __FreeBSD__
#define cpu_set_t cpuset_t
--- vmemcache-0.8.1.orig/src/out.c
+++ vmemcache-0.8.1/src/out.c
@@ -15,6 +15,7 @@
#include <string.h>
#include <errno.h>
+#include "file.h"
#include "out.h"
#include "os.h"
#include "os_thread.h"
--- vmemcache-0.8.1.orig/tests/vmemcache_test_basic.c
+++ vmemcache-0.8.1/tests/vmemcache_test_basic.c
@@ -293,9 +293,12 @@ test_new_delete(const char *dir, const c
"vmemcache_new did not fail with a file instead of a directory");
#define ERR_MSG_1 "open: Not a directory"
- if (strcmp(vmemcache_errormsg(), ERR_MSG_1))
+#define ERR_MSG_1bsd "mkstemp: Not a directory"
+ if (strcmp(vmemcache_errormsg(), ERR_MSG_1)
+ && strcmp(vmemcache_errormsg(), ERR_MSG_1bsd)) {
UT_FATAL("wrong error message: '%s' (should be '"ERR_MSG_1"')",
vmemcache_errormsg());
+ }
vmemcache_delete(cache);
/* TEST #11 - NULL directory path */
@@ -318,7 +321,7 @@ test_new_delete(const char *dir, const c
vmemcache_set_size(cache, VMEMCACHE_MIN_POOL);
vmemcache_set_extent_size(cache, VMEMCACHE_MIN_EXTENT);
vmemcache_set_eviction_policy(cache, repl_p);
- char nonexistent[PATH_MAX];
+ char nonexistent[4096];
strcpy(nonexistent, dir);
strcat(nonexistent, "/nonexistent_dir");
if (!vmemcache_add(cache, nonexistent))
--- vmemcache-0.8.1.orig/tests/vmemcache_test_utilization.c
+++ vmemcache-0.8.1/tests/vmemcache_test_utilization.c
@@ -29,7 +29,7 @@ typedef struct {
size_t pool_size;
size_t extent_size;
size_t val_max;
- char dir[PATH_MAX];
+ char dir[4096];
long seconds;
unsigned seed;
int print_output;
--- vmemcache-0.8.1.orig/tests/helpers.cmake
+++ vmemcache-0.8.1/tests/helpers.cmake
@@ -84,7 +84,8 @@ function(execute expectation name)
if (${TRACER} STREQUAL "none")
execute_arg("" ${expectation} ${name} ${ARGN})
elseif (${TRACER} STREQUAL memcheck)
- set(VG_OPT "--leak-check=full")
+ set(VAL_SUPP "${SRC_DIR}/valgrind.supp")
+ set(VG_OPT "--leak-check=full" "--suppressions=${VAL_SUPP}")
run_under_valgrind("${VG_OPT}" ${name} ${ARGN})
elseif (${TRACER} STREQUAL helgrind)
set(HEL_SUPP "${SRC_DIR}/helgrind-log.supp")
--- /dev/null
+++ vmemcache-0.8.1/tests/valgrind.supp
@@ -0,0 +1,11 @@
+{
+ <fast-hash slices by 8 bytes even on 32-bit>
+ Memcheck:Addr4
+ fun:hash
+}
+{
+ <... and is possibly rotated on bad-endian>
+ Memcheck:Addr4
+ fun:__bswap_64
+ fun:hash
+}
|