diff options
| -rw-r--r-- | meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch | 45 | ||||
| -rw-r--r-- | meta/recipes-support/db/db_5.3.28.bb | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch b/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch new file mode 100644 index 0000000000..9d51a44a26 --- /dev/null +++ b/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From 96b303caf70a7635953c36e5bfb9ad6e75cb7637 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 14 Feb 2020 14:12:59 -0800 | ||
| 4 | Subject: [PATCH] clock: Do not define own timespec | ||
| 5 | |||
| 6 | timespec is provided by libc and its best left to libc | ||
| 7 | os_gettime takes a db_timespec and passed its address to clock_gettime | ||
| 8 | which assumes that db_timespec and timespec are same but actually | ||
| 9 | its 12-bytes here and libc has 16-bytes | ||
| 10 | |||
| 11 | This can cause problems especially with 64bit time_t | ||
| 12 | |||
| 13 | Upstream-Status: Pending | ||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 15 | --- | ||
| 16 | src/dbinc/clock.h | 17 +---------------- | ||
| 17 | 1 file changed, 1 insertion(+), 16 deletions(-) | ||
| 18 | |||
| 19 | --- a/src/dbinc/clock.h | ||
| 20 | +++ b/src/dbinc/clock.h | ||
| 21 | @@ -44,22 +44,8 @@ | ||
| 22 | extern "C" { | ||
| 23 | #endif | ||
| 24 | |||
| 25 | -/* | ||
| 26 | - * This declaration is POSIX-compatible. Because there are lots of different | ||
| 27 | - * time.h include file patterns out there, it's easier to declare our own name | ||
| 28 | - * in all cases than to try and discover if a system has a struct timespec. | ||
| 29 | - * For the same reason, and because we'd have to #include <sys/time.h> in db.h, | ||
| 30 | - * we don't export any timespec structures in the DB API, even in places where | ||
| 31 | - * it would make sense, like the replication statistics information. | ||
| 32 | - */ | ||
| 33 | -typedef struct { | ||
| 34 | - time_t tv_sec; /* seconds */ | ||
| 35 | -#ifdef HAVE_MIXED_SIZE_ADDRESSING | ||
| 36 | - int32_t tv_nsec; | ||
| 37 | -#else | ||
| 38 | - long tv_nsec; /* nanoseconds */ | ||
| 39 | -#endif | ||
| 40 | -} db_timespec; | ||
| 41 | +#include <time.h> | ||
| 42 | +#define db_timespec struct timespec | ||
| 43 | |||
| 44 | /* Operations on timespecs */ | ||
| 45 | #undef timespecclear | ||
diff --git a/meta/recipes-support/db/db_5.3.28.bb b/meta/recipes-support/db/db_5.3.28.bb index a2969055a6..badb79f9ea 100644 --- a/meta/recipes-support/db/db_5.3.28.bb +++ b/meta/recipes-support/db/db_5.3.28.bb | |||
| @@ -26,6 +26,7 @@ SRC_URI += "file://fix-parallel-build.patch \ | |||
| 26 | file://0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch \ | 26 | file://0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch \ |
| 27 | file://sequence-type.patch \ | 27 | file://sequence-type.patch \ |
| 28 | file://0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch \ | 28 | file://0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch \ |
| 29 | file://0001-clock-Do-not-define-own-timespec.patch \ | ||
| 29 | " | 30 | " |
| 30 | # We are not interested in official latest 6.x versions; | 31 | # We are not interested in official latest 6.x versions; |
| 31 | # let's track what debian is using. | 32 | # let's track what debian is using. |
