Date: Fri, 8 Oct 2021 05:15:25 GMT From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5018dfb90fb3 - stable/13 - tests/sys/fs/fusefs/read.cc: fix build on powerpc64 Message-ID: <202110080515.1985FPMi030817@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5018dfb90fb3631531f1305392c34d89fbfab96a commit 5018dfb90fb3631531f1305392c34d89fbfab96a Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-09-22 22:47:10 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2021-10-08 05:15:05 +0000 tests/sys/fs/fusefs/read.cc: fix build on powerpc64 There sig_atomic_t is shorter than void *. As result, it cannot keep pointer. Assigning to void * is actually safe for us in a signal handler. (cherry picked from commit 3fcbde5e883a253f631082b128dcdf77c840d4c0) --- tests/sys/fs/fusefs/read.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/fs/fusefs/read.cc b/tests/sys/fs/fusefs/read.cc index cb82d0a43b06..3cba564affcf 100644 --- a/tests/sys/fs/fusefs/read.cc +++ b/tests/sys/fs/fusefs/read.cc @@ -109,7 +109,7 @@ class ReadSigbus: public Read { public: static jmp_buf s_jmpbuf; -static sig_atomic_t s_si_addr; +static void *s_si_addr; void TearDown() { struct sigaction sa; @@ -125,12 +125,12 @@ void TearDown() { static void handle_sigbus(int signo __unused, siginfo_t *info, void *uap __unused) { - ReadSigbus::s_si_addr = (sig_atomic_t)info->si_addr; + ReadSigbus::s_si_addr = info->si_addr; longjmp(ReadSigbus::s_jmpbuf, 1); } jmp_buf ReadSigbus::s_jmpbuf; -sig_atomic_t ReadSigbus::s_si_addr; +void *ReadSigbus::s_si_addr; /* AIO reads need to set the header's pid field correctly */ /* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236379 */ @@ -658,7 +658,7 @@ TEST_F(ReadSigbus, mmap_eio) FAIL() << "shouldn't get here"; } - ASSERT_EQ(p, (void*)ReadSigbus::s_si_addr); + ASSERT_EQ(p, ReadSigbus::s_si_addr); ASSERT_EQ(0, munmap(p, len)) << strerror(errno); leak(fd); } @@ -785,7 +785,7 @@ TEST_F(ReadSigbus, mmap_getblksz_fail) FAIL() << "shouldn't get here"; } - ASSERT_EQ(p, (void*)ReadSigbus::s_si_addr); + ASSERT_EQ(p, ReadSigbus::s_si_addr); ASSERT_EQ(0, munmap(p, len)) << strerror(errno); leak(fd); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110080515.1985FPMi030817>