fix use of uninitialized pointer in gettext core
[musl.git] / src / thread / pthread_setcancelstate.c
blob5ab8c338f7969c8d79d24fe1a9c18a7481e62555
1 #include "pthread_impl.h"
3 int __pthread_setcancelstate(int new, int *old)
5 if (new > 2U) return EINVAL;
6 struct pthread *self = __pthread_self();
7 if (old) *old = self->canceldisable;
8 self->canceldisable = new;
9 return 0;
12 weak_alias(__pthread_setcancelstate, pthread_setcancelstate);