Commit 3fcbde5e authored by Konstantin Belousov's avatar Konstantin Belousov
Browse files

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.

Reviewed by:	asomers
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Fixes:	4f917847
Differential revision:	https://reviews.freebsd.org/D32064
parent b5f90655
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment