python-cryptography: bump to version 1.7.2
[buildroot-gz.git] / package / libtirpc / 0007-Add-missing-rwlock_unlocks-in-xprt_register.patch
blob56b5bf8392fb4a0a6a6a7f232d692516df982a3b
1 From 4f1503e84b2f7bd229a097335e52fb8203f5bb0b Mon Sep 17 00:00:00 2001
2 From: Michael Forney <mforney@mforney.org>
3 Date: Wed, 4 Nov 2015 13:58:06 -0500
4 Subject: [PATCH] Add missing rwlock_unlocks in xprt_register
6 It looks like in b2c9430f46c4ac848957fb8adaac176a3f6ac03f when svc_run
7 switched to poll, an early return was added, but the rwlock was not
8 unlocked.
10 I observed that rpcbind built against libtirpc-1.0.1 would handle only
11 one request before hanging, and tracked it down to a missing
12 rwlock_unlock here.
14 Fixes: b2c9430f46c4 ('Use poll() instead of select() in svc_run()')
15 Signed-off-by: Michael Forney <mforney@mforney.org>
16 Signed-off-by: Steve Dickson <steved@redhat.com>
17 [peda@axentia.se: backport from upstream]
18 Signed-off-by: Peter Rosin <peda@axentia.se>
19 ---
20 src/svc.c | 7 ++++---
21 1 file changed, 4 insertions(+), 3 deletions(-)
23 diff --git a/src/svc.c b/src/svc.c
24 index 9c41445..b59467b 100644
25 --- a/src/svc.c
26 +++ b/src/svc.c
27 @@ -99,7 +99,7 @@ xprt_register (xprt)
29 __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *));
30 if (__svc_xports == NULL)
31 - return;
32 + goto unlock;
34 if (sock < _rpc_dtablesize())
36 @@ -120,14 +120,14 @@ xprt_register (xprt)
37 svc_pollfd[i].fd = sock;
38 svc_pollfd[i].events = (POLLIN | POLLPRI |
39 POLLRDNORM | POLLRDBAND);
40 - return;
41 + goto unlock;
44 new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
45 sizeof (struct pollfd)
46 * (svc_max_pollfd + 1));
47 if (new_svc_pollfd == NULL) /* Out of memory */
48 - return;
49 + goto unlock;
50 svc_pollfd = new_svc_pollfd;
51 ++svc_max_pollfd;
53 @@ -135,6 +135,7 @@ xprt_register (xprt)
54 svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
55 POLLRDNORM | POLLRDBAND);
57 +unlock:
58 rwlock_unlock (&svc_fd_lock);
61 --
62 2.5.3