From: David van Moolenbroek Date: Tue, 20 Aug 2013 23:05:05 +0000 (+0200) Subject: PFS: unblock the child when unsuspending an accept X-Git-Tag: v3.3.0~830 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/soc.html?a=commitdiff_plain;h=refs%2Fchanges%2F74%2F774%2F3;p=minix.git PFS: unblock the child when unsuspending an accept Previously, PFS would incorrectly try to unsuspend the parent (i.e., the listening socket), resulting in the child hanging until the other side performed another action. Test56 started failing on this now. Change-Id: I231ac5481c83ac45951d33aeecc8149273f48b11 --- diff --git a/servers/pfs/uds.c b/servers/pfs/uds.c index f28531b92..34b9d1006 100644 --- a/servers/pfs/uds.c +++ b/servers/pfs/uds.c @@ -398,7 +398,7 @@ int do_accept(message *dev_m_in, message *dev_m_out) int do_connect(message *dev_m_in, message *dev_m_out) { - int minor; + int minor, child; struct sockaddr_un addr; int rc, i, j; @@ -446,26 +446,28 @@ int do_connect(message *dev_m_in, message *dev_m_out) !strncmp(addr.sun_path, uds_fd_table[i].addr.sun_path, UNIX_PATH_MAX)) { - if (uds_fd_table[i].child != -1) { + if ((child = uds_fd_table[i].child) != -1) { /* the server is blocked on accept(2) -- * perform connection to the child */ rc = perform_connection(dev_m_in, dev_m_out, - &addr, minor, uds_fd_table[i].child); + &addr, minor, child); if (rc == OK) { uds_fd_table[i].child = -1; #if DEBUG == 1 - printf("(uds) [%d] {do_connect} revive %d\n", minor, i); + printf("(uds) [%d] {do_connect} revive %d\n", minor, child); #endif /* wake the parent (server) */ - uds_fd_table[i].ready_to_revive = 1; - uds_unsuspend(dev_m_in->m_source, i); + uds_fd_table[child].ready_to_revive = + 1; + uds_unsuspend(dev_m_in->m_source, + child); } return rc;