Patchwork coroutine-sigaltstack.c: Use stack_t, not struct sigaltstack

login
register
mail settings
Submitter Peter Maydell
Date Nov. 10, 2012, 9:47 p.m.
Message ID <1352584072-7574-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/198219/
State New
Headers show

Comments

Peter Maydell - Nov. 10, 2012, 9:47 p.m.
Use the POSIX-specified stack_t type as the argument to sigaltstack()
rather than the legacy struct sigaltstack. This allows us to compile
on MacOSX with --with-coroutine=sigaltstack.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Tested on Linux and MacOSX.

 coroutine-sigaltstack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Stefan Hajnoczi - Nov. 12, 2012, 12:57 p.m.
On Sat, Nov 10, 2012 at 10:47 PM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> Use the POSIX-specified stack_t type as the argument to sigaltstack()
> rather than the legacy struct sigaltstack. This allows us to compile
> on MacOSX with --with-coroutine=sigaltstack.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Tested on Linux and MacOSX.
>
>  coroutine-sigaltstack.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Kevin Wolf - Nov. 27, 2012, 10:53 a.m.
Am 12.11.2012 13:57, schrieb Stefan Hajnoczi:
> On Sat, Nov 10, 2012 at 10:47 PM, Peter Maydell
> <peter.maydell@linaro.org> wrote:
>> Use the POSIX-specified stack_t type as the argument to sigaltstack()
>> rather than the legacy struct sigaltstack. This allows us to compile
>> on MacOSX with --with-coroutine=sigaltstack.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> Tested on Linux and MacOSX.
>>
>>  coroutine-sigaltstack.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Thanks, applied to the block branch for 1.3.

Kevin

Patch

diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c
index 861e878..39dbaa5 100644
--- a/coroutine-sigaltstack.c
+++ b/coroutine-sigaltstack.c
@@ -171,8 +171,8 @@  static Coroutine *coroutine_new(void)
     CoroutineThreadState *coTS;
     struct sigaction sa;
     struct sigaction osa;
-    struct sigaltstack ss;
-    struct sigaltstack oss;
+    stack_t ss;
+    stack_t oss;
     sigset_t sigs;
     sigset_t osigs;
     jmp_buf old_env;