All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests/drm_read: Don't use deprecated siginterrupt
@ 2021-03-22 18:45 Arkadiusz Hiler
  2021-03-22 22:08 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Arkadiusz Hiler @ 2021-03-22 18:45 UTC (permalink / raw)
  To: igt-dev

Since we are using sigaction() we can also register the signal handler
in one go.

Fixes: "warning: ‘siginterrupt’ is deprecated: Use sigaction with SA_RESTART instead"
Signed-off-by: Arkadiusz Hiler <arek@hiler.eu>
---
 tests/drm_read.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/drm_read.c b/tests/drm_read.c
index cfb1c04d..ccf9d822 100644
--- a/tests/drm_read.c
+++ b/tests/drm_read.c
@@ -48,7 +48,7 @@
 
 IGT_TEST_DESCRIPTION("Call read(drm) and see if it behaves.");
 
-static void sighandler(int sig)
+static void sighandler(int sig, siginfo_t * info, void *context)
 {
 }
 
@@ -257,12 +257,15 @@ igt_main
 	struct igt_fb fb;
 	enum pipe pipe;
 
-	signal(SIGALRM, sighandler);
-	siginterrupt(SIGALRM, 1);
-
 	igt_fixture {
+		struct sigaction alarm_action = {};
 		igt_output_t *output;
 
+		igt_assert_neq(sigaction(SIGALRM, NULL, &alarm_action), -1);
+		alarm_action.sa_flags &= ~SA_RESTART;
+		alarm_action.sa_sigaction = sighandler;
+		igt_assert_neq(sigaction(SIGALRM, &alarm_action, NULL), -1);
+
 		fd = drm_open_driver_master(DRIVER_ANY);
 		kmstest_set_vt_graphics_mode();
 
-- 
2.31.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-03-24 13:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 18:45 [igt-dev] [PATCH] tests/drm_read: Don't use deprecated siginterrupt Arkadiusz Hiler
2021-03-22 22:08 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2021-03-23 19:04   ` Arkadiusz Hiler
2021-03-23 20:19     ` Juha-Pekka Heikkila
2021-03-23 21:22       ` Arkadiusz Hiler
2021-03-24  7:57     ` Saarinen, Jani
2021-03-23 20:24 ` Patchwork
2021-03-23 20:54 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2021-03-24  8:56 ` [igt-dev] [PATCH] " Petri Latvala
2021-03-24 13:17 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.