nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

at litex 109 lines 3.2 kB view raw
1From e84f40ca872f0bce72b5686c95a11739d9c89494 Mon Sep 17 00:00:00 2001 2From: Steffen <steffen.winter@proton.me> 3Date: Mon, 13 Feb 2023 17:56:03 +0100 4Subject: [PATCH 2/3] test: Use t_error instead of glibc's error. 5 6On musl systems, liburing cannot build examples and tests due to 7it's usage of error.h. Replacing calls to error() with t_error(). 8 9Closes: #786 10 11Signed-off-by: Steffen Winter <steffen.winter@proton.me> 12--- 13 test/defer-taskrun.c | 1 - 14 test/send-zerocopy.c | 1 - 15 test/single-issuer.c | 15 +++++++-------- 16 3 files changed, 7 insertions(+), 10 deletions(-) 17 18diff --git a/test/defer-taskrun.c b/test/defer-taskrun.c 19index 9283f28..87cd256 100644 20--- a/test/defer-taskrun.c 21+++ b/test/defer-taskrun.c 22@@ -4,7 +4,6 @@ 23 #include <unistd.h> 24 #include <stdlib.h> 25 #include <string.h> 26-#include <error.h> 27 #include <sys/eventfd.h> 28 #include <signal.h> 29 #include <poll.h> 30diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c 31index 4db102b..be33094 100644 32--- a/test/send-zerocopy.c 33+++ b/test/send-zerocopy.c 34@@ -4,7 +4,6 @@ 35 #include <stdint.h> 36 #include <assert.h> 37 #include <errno.h> 38-#include <error.h> 39 #include <limits.h> 40 #include <fcntl.h> 41 #include <unistd.h> 42diff --git a/test/single-issuer.c b/test/single-issuer.c 43index 1d13f47..d71cd74 100644 44--- a/test/single-issuer.c 45+++ b/test/single-issuer.c 46@@ -5,7 +5,6 @@ 47 #include <stdlib.h> 48 #include <string.h> 49 #include <fcntl.h> 50-#include <error.h> 51 #include <sys/types.h> 52 #include <sys/wait.h> 53 54@@ -56,13 +55,13 @@ static int try_submit(struct io_uring *ring) 55 return ret; 56 57 if (ret != 1) 58- error(1, ret, "submit %i", ret); 59+ t_error(1, ret, "submit %i", ret); 60 ret = io_uring_wait_cqe(ring, &cqe); 61 if (ret) 62- error(1, ret, "wait fail %i", ret); 63+ t_error(1, ret, "wait fail %i", ret); 64 65 if (cqe->res || cqe->user_data != 42) 66- error(1, ret, "invalid cqe"); 67+ t_error(1, ret, "invalid cqe"); 68 69 io_uring_cqe_seen(ring, cqe); 70 return 0; 71@@ -106,7 +105,7 @@ int main(int argc, char *argv[]) 72 ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER | 73 IORING_SETUP_R_DISABLED); 74 if (ret) 75- error(1, ret, "ring init (2) %i", ret); 76+ t_error(1, ret, "ring init (2) %i", ret); 77 78 if (!fork_t()) { 79 io_uring_enable_rings(&ring); 80@@ -122,7 +121,7 @@ int main(int argc, char *argv[]) 81 ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER | 82 IORING_SETUP_R_DISABLED); 83 if (ret) 84- error(1, ret, "ring init (3) %i", ret); 85+ t_error(1, ret, "ring init (3) %i", ret); 86 87 io_uring_enable_rings(&ring); 88 if (!fork_t()) { 89@@ -137,7 +136,7 @@ int main(int argc, char *argv[]) 90 /* test that anyone can submit to a SQPOLL|SINGLE_ISSUER ring */ 91 ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER|IORING_SETUP_SQPOLL); 92 if (ret) 93- error(1, ret, "ring init (4) %i", ret); 94+ t_error(1, ret, "ring init (4) %i", ret); 95 96 ret = try_submit(&ring); 97 if (ret) { 98@@ -157,7 +156,7 @@ int main(int argc, char *argv[]) 99 /* test that IORING_ENTER_REGISTERED_RING doesn't break anything */ 100 ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER); 101 if (ret) 102- error(1, ret, "ring init (5) %i", ret); 103+ t_error(1, ret, "ring init (5) %i", ret); 104 105 if (!fork_t()) { 106 ret = try_submit(&ring); 107-- 1082.39.1 109