diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2021-11-21 04:17:49 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2021-11-21 04:18:16 +0100 |
commit | 5eda431bfc0b8afd8f15fb3127cd32caf93ff120 (patch) | |
tree | 50eeb9b956f4080bffbf9f04e2d15237e2e03b0c /sys-libs/libfaketime | |
parent | www-client/qutebrowser: stabilize 2.4.0 for amd64 (diff) | |
download | gentoo-5eda431bfc0b8afd8f15fb3127cd32caf93ff120.tar.gz gentoo-5eda431bfc0b8afd8f15fb3127cd32caf93ff120.tar.bz2 gentoo-5eda431bfc0b8afd8f15fb3127cd32caf93ff120.zip |
sys-libs/libfaketime: treat unknown clock_ids like CLOCK_REALTIME
Backport of commit bb635e4367adcac2c1517a698799a60a2bf86e83 upstream.
Bug: https://bugs.gentoo.org/733590
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'sys-libs/libfaketime')
-rw-r--r-- | sys-libs/libfaketime/files/libfaketime-0.9.8-Treat-unknown-clock_ids-like-CLOCK_REALTIME.patch | 35 | ||||
-rw-r--r-- | sys-libs/libfaketime/libfaketime-0.9.6-r4.ebuild (renamed from sys-libs/libfaketime/libfaketime-0.9.6-r3.ebuild) | 2 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sys-libs/libfaketime/files/libfaketime-0.9.8-Treat-unknown-clock_ids-like-CLOCK_REALTIME.patch b/sys-libs/libfaketime/files/libfaketime-0.9.8-Treat-unknown-clock_ids-like-CLOCK_REALTIME.patch new file mode 100644 index 000000000000..13d7698ec1bd --- /dev/null +++ b/sys-libs/libfaketime/files/libfaketime-0.9.8-Treat-unknown-clock_ids-like-CLOCK_REALTIME.patch @@ -0,0 +1,35 @@ +From bb635e4367adcac2c1517a698799a60a2bf86e83 Mon Sep 17 00:00:00 2001 +From: Wolfgang Hommel <wolf@code-wizards.com> +Date: Thu, 30 Nov 2017 20:28:06 +0100 +Subject: [PATCH] Treat unknown clock_ids like CLOCK_REALTIME (experimental) + +--- + src/libfaketime.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/libfaketime.c b/src/libfaketime.c +index b59298c..b36c75b 100644 +--- a/src/libfaketime.c ++++ b/src/libfaketime.c +@@ -2020,8 +2020,8 @@ int fake_clock_gettime(clockid_t clk_id, struct timespec *tp) + break; + #endif + default: +- printf("Invalid clock_id for clock_gettime: %d", clk_id); +- exit(EXIT_FAILURE); ++ timespecsub(tp, &ftpl_starttime.real, &tmp_ts); ++ break; + } + + if (limited_faking) +@@ -2171,8 +2171,8 @@ int fake_clock_gettime(clockid_t clk_id, struct timespec *tp) + break; + #endif + default: +- printf("Invalid clock_id for clock_gettime: %d", clk_id); +- exit(EXIT_FAILURE); ++ timespecsub(tp, &ftpl_starttime.real, &tdiff); ++ break; + } // end of switch (clk_id) + if (user_rate_set) + { diff --git a/sys-libs/libfaketime/libfaketime-0.9.6-r3.ebuild b/sys-libs/libfaketime/libfaketime-0.9.6-r4.ebuild index b115280410ee..0d1e323682b4 100644 --- a/sys-libs/libfaketime/libfaketime-0.9.6-r3.ebuild +++ b/sys-libs/libfaketime/libfaketime-0.9.6-r4.ebuild @@ -13,6 +13,8 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~ppc ~ppc64 -riscv sparc x86" +PATCHES=( "${FILESDIR}"/${PN}-0.9.8-Treat-unknown-clock_ids-like-CLOCK_REALTIME.patch ) + src_prepare() { default |