OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
1 | From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001 |
1 | From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001 |
|
2 | From: Yousong Zhou <yszhou4tech@gmail.com> |
2 | From: Yousong Zhou <yszhou4tech@gmail.com> |
|
3 | Date: Fri, 24 Mar 2017 10:36:03 +0800 |
3 | Date: Fri, 24 Mar 2017 10:36:03 +0800 |
|
4 | Subject: [PATCH] Fix invalid sigprocmask call |
4 | Subject: [PATCH] Fix invalid sigprocmask call |
|
5 | |
5 | |
|
6 | The POSIX document says |
6 | The POSIX document says |
|
7 | |
7 | |
|
8 | The pthread_sigmask() and sigprocmask() functions shall fail if: |
8 | The pthread_sigmask() and sigprocmask() functions shall fail if: |
|
9 | |
9 | |
|
10 | [EINVAL] |
10 | [EINVAL] |
|
11 | The value of the how argument is not equal to one of the defined values. |
11 | The value of the how argument is not equal to one of the defined values. |
|
12 | |
12 | |
|
13 | and this is how musl-libc is currently doing. Fix the call to be safe |
13 | and this is how musl-libc is currently doing. Fix the call to be safe |
|
14 | and correct |
14 | and correct |
|
15 | |
15 | |
|
16 | [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html |
16 | [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html |
|
17 | |
17 | |
|
18 | gdb/ChangeLog: |
18 | gdb/ChangeLog: |
|
19 | 2017-03-24 Yousong Zhou <yszhou4tech@gmail.com> |
19 | 2017-03-24 Yousong Zhou <yszhou4tech@gmail.com> |
|
20 | |
20 | |
|
21 | * common/signals-state-save-restore.c (save_original_signals_state): |
21 | * common/signals-state-save-restore.c (save_original_signals_state): |
|
22 | Fix invalid sigprocmask call. |
22 | Fix invalid sigprocmask call. |
|
23 | --- |
23 | --- |
|
24 | gdb/ChangeLog | 5 +++++ |
24 | gdb/ChangeLog | 5 +++++ |
|
25 | gdb/common/signals-state-save-restore.c | 2 +- |
25 | gdb/common/signals-state-save-restore.c | 2 +- |
|
26 | 2 files changed, 6 insertions(+), 1 deletion(-) |
26 | 2 files changed, 6 insertions(+), 1 deletion(-) |
|
27 | |
27 | |
|
28 | --- a/gdb/common/signals-state-save-restore.c |
28 | --- a/gdb/common/signals-state-save-restore.c |
|
29 | +++ b/gdb/common/signals-state-save-restore.c |
29 | +++ b/gdb/common/signals-state-save-restore.c |
|
30 | @@ -41,7 +41,7 @@ save_original_signals_state (bool quiet) |
30 | @@ -41,7 +41,7 @@ save_original_signals_state (void) |
|
31 | int i; |
31 | int i; |
|
32 | int res; |
32 | int res; |
|
33 | |
33 | |
|
34 | - res = sigprocmask (0, NULL, &original_signal_mask); |
34 | - res = sigprocmask (0, NULL, &original_signal_mask); |
|
35 | + res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask); |
35 | + res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask); |
|
36 | if (res == -1) |
36 | if (res == -1) |
|
37 | perror_with_name (("sigprocmask")); |
37 | perror_with_name (("sigprocmask")); |
|
38 | |
38 | |
|
39 | |
39 | |