mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-kselftest@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	John Stultz <john.stultz@linaro.org>,
	Shuah Khan <shuah@kernel.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Kosaki Motohiro <kosaki.motohiro@gmail.com>,
	Olivier Langlois <olivier@trillion01.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH] selftests: posix_timers: Make signal handling safer
Date: Tue, 21 Nov 2017 21:10:56 +0100	[thread overview]
Message-ID: <7ba0d855-8b55-cb38-2740-c2a3495f3083@users.sourceforge.net> (raw)

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

                 reply	other threads:[~2017-11-21 20:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ba0d855-8b55-cb38-2740-c2a3495f3083@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=olivier@trillion01.com \
    --cc=rostedt@goodmis.org \
    --cc=sboyd@codeaurora.org \
    --cc=sgruszka@redhat.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®