Files
haikuports/dev-db/sqlcipher/patches/sqlcipher-3.4.2.patchset
2018-01-11 09:56:37 +01:00

67 lines
1.9 KiB
Plaintext

From 1d3282d6038bc327fea78482a6c991e05d76aab8 Mon Sep 17 00:00:00 2001
From: Leorize <alaviss@users.noreply.github.com>
Date: Wed, 10 Jan 2018 17:22:55 +0700
Subject: crypto: include <sys/mman.h> unless WAL is omitted
crypto_impl.c is included before os_unix.c, which means if an user
define OMIT_MEMLOCK, <sys/mman.h> won't be included, which is needed for
WAL
diff --git a/src/crypto_impl.c b/src/crypto_impl.c
index 1fd35ba..b516386 100644
--- a/src/crypto_impl.c
+++ b/src/crypto_impl.c
@@ -40,11 +40,13 @@
#include <errno.h>
#include <unistd.h>
#include <sys/resource.h>
-#include <sys/mman.h>
#elif defined(_WIN32)
#include <windows.h>
#endif
#endif
+#if !defined(SQLITE_OMIT_WAL) && SQLITE_OS_UNIX
+#include <sys/mman.h>
+#endif
/* the default implementation of SQLCipher uses a cipher_ctx
to keep track of read / write state separately. The following
--
2.15.0
From ce7e259cd0d8346f481a1d3e88eaafabe764419f Mon Sep 17 00:00:00 2001
From: Leorize <alaviss@users.noreply.github.com>
Date: Wed, 10 Jan 2018 20:47:29 +0700
Subject: test1: fixes for Haiku
diff --git a/src/test1.c b/src/test1.c
index df7685f..f21be6b 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -6568,10 +6568,16 @@ static int SQLITE_TCLAPI test_getrusage(
getrusage(RUSAGE_SELF, &r);
sqlite3_snprintf(sizeof(buf), buf,
- "ru_utime=%d.%06d ru_stime=%d.%06d ru_minflt=%d ru_majflt=%d",
- (int)r.ru_utime.tv_sec, (int)r.ru_utime.tv_usec,
- (int)r.ru_stime.tv_sec, (int)r.ru_stime.tv_usec,
- (int)r.ru_minflt, (int)r.ru_majflt
+ "ru_utime=%d.%06d ru_stime=%d.%06d"
+#ifndef __HAIKU__
+ " ru_minflt=%d ru_majflt=%d"
+#endif
+ ,
+ (int)r.ru_utime.tv_sec, (int)r.ru_utime.tv_usec,
+ (int)r.ru_stime.tv_sec, (int)r.ru_stime.tv_usec
+#ifndef __HAIKU__
+ , (int)r.ru_minflt, (int)r.ru_majflt
+#endif
);
Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1));
return TCL_OK;
--
2.15.0