diff options
Diffstat (limited to 'meta-oe/recipes-support/gnutls/gnutls-2.10.4/gnutls-replace-siginterrupt.patch')
-rw-r--r-- | meta-oe/recipes-support/gnutls/gnutls-2.10.4/gnutls-replace-siginterrupt.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/gnutls/gnutls-2.10.4/gnutls-replace-siginterrupt.patch b/meta-oe/recipes-support/gnutls/gnutls-2.10.4/gnutls-replace-siginterrupt.patch new file mode 100644 index 0000000000..a0fb64fab0 --- /dev/null +++ b/meta-oe/recipes-support/gnutls/gnutls-2.10.4/gnutls-replace-siginterrupt.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | --- | ||
2 | src/tests.c | 12 ++++++++++-- | ||
3 | 1 file changed, 10 insertions(+), 2 deletions(-) | ||
4 | |||
5 | Index: gnutls-2.8.6/src/tests.c | ||
6 | =================================================================== | ||
7 | --- gnutls-2.8.6.orig/src/tests.c 2009-06-02 11:59:32.000000000 -0700 | ||
8 | +++ gnutls-2.8.6/src/tests.c 2010-05-19 22:20:51.703780601 -0700 | ||
9 | @@ -493,6 +493,7 @@ test_bye (gnutls_session_t session) | ||
10 | int old, secs = 6; | ||
11 | |||
12 | #ifndef _WIN32 | ||
13 | + struct sigaction act; | ||
14 | signal (SIGALRM, got_alarm); | ||
15 | #endif | ||
16 | |||
17 | @@ -513,7 +514,9 @@ test_bye (gnutls_session_t session) | ||
18 | return TEST_FAILED; | ||
19 | |||
20 | #ifndef _WIN32 | ||
21 | - old = siginterrupt (SIGALRM, 1); | ||
22 | + (void) sigaction(SIGALRM, NULL, &act); | ||
23 | + act.sa_flags &= ~SA_RESTART; | ||
24 | + old = sigaction(SIGALRM, &act, NULL); | ||
25 | alarm (secs); | ||
26 | #else | ||
27 | setsockopt ((int) gnutls_transport_get_ptr (session), SOL_SOCKET, | ||
28 | @@ -527,7 +530,12 @@ test_bye (gnutls_session_t session) | ||
29 | while (ret > 0); | ||
30 | |||
31 | #ifndef _WIN32 | ||
32 | - siginterrupt (SIGALRM, old); | ||
33 | + (void) sigaction(SIGALRM, NULL, &act); | ||
34 | + if (old) | ||
35 | + act.sa_flags &= ~SA_RESTART; | ||
36 | + else | ||
37 | + act.sa_flags |= SA_RESTART; | ||
38 | + sigaction(SIGALRM, &act, NULL); | ||
39 | #else | ||
40 | if (WSAGetLastError () == WSAETIMEDOUT || | ||
41 | WSAGetLastError () == WSAECONNABORTED) | ||