git: 836a76ad95be - main - tests/inotify: Make an error message more useful

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Thu, 09 Jul 2026 13:41:47 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=836a76ad95be2fcf2cd116d754c5888a731d57aa

commit 836a76ad95be2fcf2cd116d754c5888a731d57aa
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-07-08 17:09:42 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-07-09 13:41:27 +0000

    tests/inotify: Make an error message more useful
    
    MFC after:      3 days
---
 tests/sys/kern/inotify_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/sys/kern/inotify_test.c b/tests/sys/kern/inotify_test.c
index 9d5265e71f95..0c2cc260f29e 100644
--- a/tests/sys/kern/inotify_test.c
+++ b/tests/sys/kern/inotify_test.c
@@ -96,7 +96,8 @@ consume_event_cookie(int ifd, int wd, unsigned int event, unsigned int flags,
 	ATF_REQUIRE(ev != NULL);
 
 	n = read(ifd, ev, evsz);
-	ATF_REQUIRE_MSG(n >= 0, "failed to read event %s", ev2name(event));
+	ATF_REQUIRE_MSG(n >= 0, "failed to read event %s: %s",
+	    ev2name(event), strerror(errno));
 	ATF_REQUIRE((size_t)n >= sizeof(*ev));
 	ATF_REQUIRE((size_t)n == sizeof(*ev) + ev->len);
 	ATF_REQUIRE((size_t)n == evsz);