diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2017-03-27 07:19:57 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2017-03-28 01:55:41 -0400 |
commit | df189a8644d7a805bb3e278f61983c5ba8619188 (patch) | |
tree | cd5426066a4b30e925b7731cb636c836195f9035 /libglusterfs/src | |
parent | 12921693b572f642156d3167d1c92d3449dfc8ec (diff) |
syncop: Fix args for makecontext
Passing 64bit arguments to makecontext is not portable and manpage says the following:
<snip>
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).
</snip>
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 <pkarampu@redhat.com>
Reviewed-on: https://review.gluster.org/16951
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/syncop.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |