From df189a8644d7a805bb3e278f61983c5ba8619188 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 27 Mar 2017 07:19:57 +0530 Subject: syncop: Fix args for makecontext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passing 64bit arguments to makecontext is not portable and manpage says the following: On architectures where int and pointer types are the same size (e.g., x86-32, where both types are 32 bits), you may be able to get away with passing pointers as argu‐ ments to makecontext() following argc. However, doing this is not guaranteed to be portable, is undefined according to the standards, and won't work on architectures where pointers are larger than ints. Nevertheless, starting with version 2.8, glibc makes some changes to makecontext(), to permit this on some 64-bit architectures (e.g., x86-64). Since we do not depend on the arguments, it is better to change makecontext to not take any arguments. BUG: 1434274 Change-Id: Ic46c9e9faaeb2f78e4efde353ef861466515b1ec Signed-off-by: Pranith Kumar K Reviewed-on: https://review.gluster.org/16951 Smoke: Gluster Build System Reviewed-by: Ravishankar N CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- libglusterfs/src/syncop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/syncop.c') diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 021834ed42d..3fa798a4342 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -364,7 +364,7 @@ synctask_wake (struct synctask *task) } void -synctask_wrap (struct synctask *old_task) +synctask_wrap (void) { struct synctask *task = NULL; @@ -509,7 +509,7 @@ synctask_create (struct syncenv *env, size_t stacksize, synctask_fn_t fn, newtask->ctx.uc_stack.ss_sp = newtask->stack; - makecontext (&newtask->ctx, (void (*)(void)) synctask_wrap, 1, newtask); + makecontext (&newtask->ctx, (void (*)(void)) synctask_wrap, 0); newtask->state = SYNCTASK_INIT; -- cgit