summaryrefslogtreecommitdiff
path: root/libpthread/pthread/pt-setcancelstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/pthread/pt-setcancelstate.c')
-rw-r--r--libpthread/pthread/pt-setcancelstate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpthread/pthread/pt-setcancelstate.c b/libpthread/pthread/pt-setcancelstate.c
index ded58922..e2d81833 100644
--- a/libpthread/pthread/pt-setcancelstate.c
+++ b/libpthread/pthread/pt-setcancelstate.c
@@ -35,7 +35,8 @@ pthread_setcancelstate (int state, int *oldstate)
break;
}
- *oldstate = p->cancel_state;
+ if (oldstate)
+ *oldstate = p->cancel_state;
p->cancel_state = state;
return 0;