linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: posix_timers: Make signal handling safer
@ 2017-11-21 20:10 SF Markus Elfring
  0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2017-11-21 20:10 UTC (permalink / raw)
  To: linux-kselftest, Frederic Weisbecker, John Stultz, Shuah Khan,
	Stephen Boyd, Thomas Gleixner
  Cc: LKML, kernel-janitors, Andrew Morton, Kosaki Motohiro,
	Olivier Langlois, Peter Zijlstra, Stanislaw Gruszka,
	Steven Rostedt

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 21 Nov 2017 20:56:51 +0100

Use the data type "sig_atomic_t" for the variable "done"
so that it can be safely modified by a signal handler.

Fixes: 0bc4b0cf15708fca04095232c4e448634e94d029 ("selftests: add basic posix timers selftests")

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 tools/testing/selftests/timers/posix_timers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c
index 15cf56d32155..d64732c8b69a 100644
--- a/tools/testing/selftests/timers/posix_timers.c
+++ b/tools/testing/selftests/timers/posix_timers.c
@@ -20,7 +20,7 @@
 #define DELAY 2
 #define USECS_PER_SEC 1000000
 
-static volatile int done;
+static sig_atomic_t done;
 
 /* Busy loop in userspace to elapse ITIMER_VIRTUAL */
 static void user_loop(void)
-- 
2.15.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-21 20:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21 20:10 [PATCH] selftests: posix_timers: Make signal handling safer SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).