All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tales Aparecida <tales.aparecida@gmail.com>
To: igt-dev@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>
Cc: siqueirajordao@riseup.net, magalilemes00@gmail.com,
	tales.aparecida@gmail.com, Isabella Basso <isabbasso@riseup.net>,
	andrealmeid@riseup.net, Trevor Woerner <twoerner@gmail.com>
Subject: [igt-dev] [PATCH i-g-t 3/4] lib/kselftests: return non-zero on open(kmsg) failure
Date: Wed,  3 Aug 2022 02:26:53 -0300	[thread overview]
Message-ID: <20220803052654.98827-4-tales.aparecida@gmail.com> (raw)
In-Reply-To: <20220803052654.98827-1-tales.aparecida@gmail.com>

Previously igt_kselftest_begin() always returned 0.
Return non-zero if failed to open kmsg, instead.

Signed-off-by: Tales Aparecida <tales.aparecida@gmail.com>
---
 lib/igt_kmod.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index bde0461a..63636243 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -933,6 +933,8 @@ int igt_kselftest_begin(struct igt_kselftest *tst)
 	igt_require(err == 0 || err == -ENOENT);
 
 	tst->kmsg = open("/dev/kmsg", O_RDONLY | O_NONBLOCK);
+	if (tst->kmsg < 0)
+		return 1;
 
 	return 0;
 }
-- 
2.37.0

  parent reply	other threads:[~2022-08-03  5:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03  5:26 [igt-dev] [PATCH i-g-t 0/4] add kselftest runner documentation Tales Aparecida
2022-08-03  5:26 ` [igt-dev] [PATCH i-g-t 1/4] lib/igt_kmod: fix trivial typos Tales Aparecida
2022-08-03 17:13   ` Kamil Konieczny
2022-08-03  5:26 ` [igt-dev] [PATCH i-g-t 2/4] CONTRIBUTING: Add reference for GTKDoc Tales Aparecida
2022-08-03  5:26 ` Tales Aparecida [this message]
2022-08-03 17:11   ` [igt-dev] [PATCH i-g-t 3/4] lib/kselftests: return non-zero on open(kmsg) failure Kamil Konieczny
2022-08-03 20:04     ` Tales
2022-08-04 18:09   ` Maíra Canal
2022-08-03  5:26 ` [igt-dev] [PATCH i-g-t 4/4] lib/igt_kmod: add igt_kselftests documentation Tales Aparecida
2022-08-03  8:47   ` Petri Latvala
2022-08-03 15:49     ` Tales
2022-08-03  6:00 ` [igt-dev] ✓ Fi.CI.BAT: success for add kselftest runner documentation Patchwork
2022-08-03 13:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20220803052654.98827-4-tales.aparecida@gmail.com \
    --to=tales.aparecida@gmail.com \
    --cc=andrealmeid@riseup.net \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=isabbasso@riseup.net \
    --cc=magalilemes00@gmail.com \
    --cc=siqueirajordao@riseup.net \
    --cc=twoerner@gmail.com \
    /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 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.