blob: 601a698fdf1568c7753dfdbaf22dd3d4839d195d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
---
libpthread/pthread/pt-setcancelstate.c | 3 ++-
libpthread/pthread/pt-setcanceltype.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
--- a/libpthread/pthread/pt-setcancelstate.c
+++ b/libpthread/pthread/pt-setcancelstate.c
@@ -35,7 +35,8 @@ pthread_setcancelstate (int state, int *
break;
}
- *oldstate = p->cancel_state;
+ if (oldstate)
+ *oldstate = p->cancel_state;
p->cancel_state = state;
return 0;
--- a/libpthread/pthread/pt-setcanceltype.c
+++ b/libpthread/pthread/pt-setcanceltype.c
@@ -35,7 +35,8 @@ pthread_setcanceltype (int type, int *ol
break;
}
- *oldtype = p->cancel_type;
+ if (oldtype)
+ *oldtype = p->cancel_type;
p->cancel_type = type;
return 0;
|