diff options
author | deischen <deischen@FreeBSD.org> | 2002-01-11 19:46:08 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2002-01-11 19:46:08 +0000 |
commit | 732c36b4f36c769b32527e284c24877de4ec588e (patch) | |
tree | 134e0e541818593b4623cf46a44e49fe449efbd2 /lib | |
parent | 6540e7cdd986786f2db32add91f71aebded17c16 (diff) | |
download | FreeBSD-src-732c36b4f36c769b32527e284c24877de4ec588e.zip FreeBSD-src-732c36b4f36c769b32527e284c24877de4ec588e.tar.gz |
Include <stddef.h> to fix build problem when namespace pollution
by <signal.h> (including <time.h> so that NULL is accidentally defined)
is removed.
Style nits.
Submitted by: bde
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/swapcontext.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libc/gen/swapcontext.c b/lib/libc/gen/swapcontext.c index 5434c0f..d58ae6d 100644 --- a/lib/libc/gen/swapcontext.c +++ b/lib/libc/gen/swapcontext.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <signal.h> +#include <stddef.h> #include <ucontext.h> __weak_reference(__swapcontext, swapcontext); @@ -36,17 +37,17 @@ __weak_reference(__swapcontext, swapcontext); int __swapcontext(ucontext_t *oucp, const ucontext_t *ucp) { - volatile int swapped; - int ret; + volatile int swapping; + int ret; if (oucp == NULL || ucp == NULL) { errno = EINVAL; ret = -1; - } - else { - swapped = 0; - if ((ret = getcontext(oucp) == 0) && (swapped == 0)) { - swapped = 1; + } else { + swapping = 0; + ret = getcontext(oucp); + if (ret == 0 && swapping == 0) { + swapping = 1; ret = setcontext(ucp); } } |