diff options
author | Arkadiusz Hiler <arek@hiler.eu> | 2021-03-22 20:45:39 +0200 |
---|---|---|
committer | Arkadiusz Hiler <arek@hiler.eu> | 2021-03-24 22:45:52 +0200 |
commit | 8e4981dad67f8416900b5088b1f32acfc904fe1a (patch) | |
tree | 7ad5b19aafc6fb29dd8b0ba0acf984c7d9131b78 /tests/drm_read.c | |
parent | 064b35bce0d265e8e9560e823c678e67630e9d7a (diff) |
tests/drm_read: Don't use deprecated siginterrupt
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>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/drm_read.c')
-rw-r--r-- | tests/drm_read.c | 11 |
1 files 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(); |