From b21470339ac8f8a1810579e814ad8f5681a6b7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Fri, 8 Dec 2023 21:27:00 +0100 Subject: [PATCH] Do not expect EINTR when sleep is interrupted on GNU/HUrd Closes: #1057785 --- ...NTR-when-sleep-is-interrupted-on-GNU.patch | 26 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 27 insertions(+) create mode 100644 debian/patches/0002-Do-not-expect-EINTR-when-sleep-is-interrupted-on-GNU.patch diff --git a/debian/patches/0002-Do-not-expect-EINTR-when-sleep-is-interrupted-on-GNU.patch b/debian/patches/0002-Do-not-expect-EINTR-when-sleep-is-interrupted-on-GNU.patch new file mode 100644 index 000000000..61ef06063 --- /dev/null +++ b/debian/patches/0002-Do-not-expect-EINTR-when-sleep-is-interrupted-on-GNU.patch @@ -0,0 +1,26 @@ +From: Mattias Ellert +Date: Fri, 8 Dec 2023 10:15:27 +0100 +Subject: Do not expect EINTR when sleep is interrupted on GNU/Hurd + +Previously `RunCMake.CTestTimeout` failed on GNU/Hurd because the +`sleep` command does not set `errno` to `EINTR` when interrupted by a +signal, which is a Linux-specific feature. + +Forwarded: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9052 +--- + Tests/RunCMake/CTestTimeout/TestTimeout.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Tests/RunCMake/CTestTimeout/TestTimeout.c b/Tests/RunCMake/CTestTimeout/TestTimeout.c +index 425548c..da397f8 100644 +--- a/Tests/RunCMake/CTestTimeout/TestTimeout.c ++++ b/Tests/RunCMake/CTestTimeout/TestTimeout.c +@@ -45,7 +45,7 @@ int main(void) + #if defined(_WIN32) + Sleep((TIMEOUT + 4) * 1000); + #elif defined(SIGNAL_IGNORE) +-# if defined(__CYGWIN__) || defined(__sun__) ++# if defined(__CYGWIN__) || defined(__sun__) || defined(__GNU__) + # define ERRNO_IS_EINTR (errno == EINTR || errno == 0) + # else + # define ERRNO_IS_EINTR (errno == EINTR) diff --git a/debian/patches/series b/debian/patches/series index 812333042..eecedc573 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Prefer-default-Python-version.patch +0002-Do-not-expect-EINTR-when-sleep-is-interrupted-on-GNU.patch