projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify cancellation point handling
[musl]
/
src
/
thread
/
pthread_setcancelstate.c
diff --git
a/src/thread/pthread_setcancelstate.c
b/src/thread/pthread_setcancelstate.c
index
a85cc80
..
aa0ddcd
100644
(file)
--- a/
src/thread/pthread_setcancelstate.c
+++ b/
src/thread/pthread_setcancelstate.c
@@
-3,8
+3,8
@@
int pthread_setcancelstate(int new, int *old)
{
struct pthread *self = pthread_self();
int pthread_setcancelstate(int new, int *old)
{
struct pthread *self = pthread_self();
- if (old) *old = self->canceldisable
& 1
;
- if (
(unsigned)new > 1
) return EINVAL;
- self->canceldisable =
(self->canceldisable & ~1) |
new;
+ if (old) *old = self->canceldisable;
+ if (
new > 1U
) return EINVAL;
+ self->canceldisable = new;
return 0;
}
return 0;
}