Skip to content

Commit

Permalink
selftests/powerpc: Fix to use ucontext_t instead of struct ucontext
Browse files Browse the repository at this point in the history
With glibc 2.26 'struct ucontext' is removed to improve POSIX
compliance, which breaks powerpc/alignment_handler selftest. Fix the
test by using ucontext_t. Tested on ppc, works with older glibc
versions as well.

Fixes the following:
  alignment_handler.c: In function ‘sighandler’:
  alignment_handler.c:68:5: error: dereferencing pointer to incomplete type ‘struct ucontext’
    ucp->uc_mcontext.gp_regs[PT_NIP] += 4;

Signed-off-by: Harish <harish@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Harish authored and Michael Ellerman committed Feb 13, 2018
1 parent 9109617 commit ecdf06e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ volatile int gotsig;

void sighandler(int sig, siginfo_t *info, void *ctx)
{
struct ucontext *ucp = ctx;
ucontext_t *ucp = ctx;

if (!testing) {
signal(sig, SIG_DFL);
Expand Down

0 comments on commit ecdf06e

Please sign in to comment.