X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_setcancelstate.c;h=a85cc800f7c64f8736133c2fad6ec6bff3ee791f;hb=2cff36a84f268c09f4c9dc5a1340652c8e298dc0;hp=23c38851a5910fe88aad2205dd35154d41708277;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=oweals%2Fmusl.git diff --git a/src/thread/pthread_setcancelstate.c b/src/thread/pthread_setcancelstate.c index 23c38851..a85cc800 100644 --- 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(); - if (old) *old = self->canceldisable; + if (old) *old = self->canceldisable & 1; if ((unsigned)new > 1) return EINVAL; - self->canceldisable = new; + self->canceldisable = (self->canceldisable & ~1) | new; return 0; }