From 51027e997137820920806ab92b2637d68602a855368107068d4f0d8921ebb876 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Fri, 8 Jul 2022 13:50:50 +0000 Subject: [PATCH] Accepting request 987907 from home:dirkmueller:Factory - add handle-eintr.patch, enable tests everywhere OBS-URL: https://build.opensuse.org/request/show/987907 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/liburing?expand=0&rev=18 --- handle-eintr.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++ liburing.changes | 5 +++++ liburing.spec | 9 ++++---- 3 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 handle-eintr.patch diff --git a/handle-eintr.patch b/handle-eintr.patch new file mode 100644 index 0000000..394b27f --- /dev/null +++ b/handle-eintr.patch @@ -0,0 +1,52 @@ +--- liburing-2.2/test/ce593a6c480a.c ++++ liburing-2.2/test/ce593a6c480a.c +@@ -111,15 +111,16 @@ + (void*) (intptr_t) other_fd); + + /* Wait on the event fd for an event to be ready */ +- ret = read(loop_fd, buf, 8); +- if (ret < 0) { +- perror("read"); +- return 1; +- } else if (ret != 8) { +- fprintf(stderr, "Odd-sized eventfd read: %d\n", ret); +- return 1; +- } +- ++ do { ++ ret = read(loop_fd, buf, 8); ++ if (ret < 0 && errno != EINTR) { ++ perror("read"); ++ return 1; ++ } else if (ret > 0 && ret != 8) { ++ fprintf(stderr, "Odd-sized eventfd read: %d\n", ret); ++ return 1; ++ } ++ } while (ret < 0); + + ret = io_uring_wait_cqe(&ring, &cqe); + if (ret) { +--- liburing-2.2/test/io-cancel.c ++++ liburing-2.2/test/io-cancel.c +@@ -366,10 +366,17 @@ + } else { + int wstatus; + +- if (waitpid(p, &wstatus, 0) == (pid_t)-1) { +- perror("waitpid()"); +- return 1; +- } ++ do { ++ if (waitpid(p, &wstatus, 0) == (pid_t)-1) { ++ if (errno == EINTR) { ++ continue; ++ } ++ perror("waitpid()"); ++ return 1; ++ } ++ break; ++ } while (1); ++ + if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus)) { + fprintf(stderr, "child failed %i\n", WEXITSTATUS(wstatus)); + return 1; diff --git a/liburing.changes b/liburing.changes index 021c868..7ca7af8 100644 --- a/liburing.changes +++ b/liburing.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jul 8 12:40:13 UTC 2022 - Dirk Müller + +- add handle-eintr.patch, enable tests everywhere + ------------------------------------------------------------------- Wed Jun 29 11:28:10 UTC 2022 - Dirk Müller diff --git a/liburing.spec b/liburing.spec index ff71c64..7cc0405 100644 --- a/liburing.spec +++ b/liburing.spec @@ -25,6 +25,10 @@ License: (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT Group: Development/Libraries/C and C++ URL: https://git.kernel.dk/cgit/liburing Source: https://git.kernel.dk/cgit/liburing/snapshot/%{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM: has been accepted upstream +# [1/1] Handle EINTR in tests +# commit: fa67f6aedcfdaffc14cbf0b631253477b2565ef0 +Patch2: handle-eintr.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: procps @@ -56,7 +60,7 @@ This package provides header files to include and libraries to link with for the Linux-native io_uring. %prep -%setup -q +%autosetup -p1 %build # not autotools, so configure macro doesn't work @@ -69,10 +73,7 @@ sh ./configure --prefix=%{_prefix} \ %make_build -C src %check -# tests are broken on ppc64 due to bsc#1200564 -%ifnarch ppc64le /usr/bin/make runtests -%endif %install %make_install