public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4] input/input06: Fix auto-repeat key test
Date: Fri, 8 Sep 2017 14:20:35 +0200	[thread overview]
Message-ID: <20170908122035.GA4351@rei.lan> (raw)
In-Reply-To: <20170905225547.119211-1-sspatil@google.com>

Hi!
Pushed with this diff, thanks.

diff --git a/testcases/kernel/input/input06.c b/testcases/kernel/input/input06.c
index a15d11225..4c5f1a867 100644
--- a/testcases/kernel/input/input06.c
+++ b/testcases/kernel/input/input06.c
@@ -126,6 +126,9 @@ static void read_events(void)
        if (rd < 0)
                tst_brkm(TBROK | TERRNO, cleanup, "read() failed");
 
+       if (rd == 0)
+               tst_brkm(TBROK, cleanup, "Failed to read events");
+
        if (rd % sizeof(struct input_event) != 0) {
                tst_brkm(TBROK, cleanup, "read size %i not multiple of %zu",
                         rd, sizeof(struct input_event));


So that we do not return bogus event in next_event() in a case that the read()
has returned 0, which should not happen under normal conditions, but let's
handle that as well in a case that something went wrong...

-- 
Cyril Hrubis
chrubis@suse.cz

      reply	other threads:[~2017-09-08 12:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 22:55 [LTP] [PATCH v4] input/input06: Fix auto-repeat key test Sandeep Patil
2017-09-08 12:20 ` Cyril Hrubis [this message]

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=20170908122035.GA4351@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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