From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4E3DE139085 for ; Mon, 16 Jan 2017 10:01:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A3760E0FCA; Mon, 16 Jan 2017 10:01:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 816DCE0FCA for ; Mon, 16 Jan 2017 10:01:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1291133BF43 for ; Mon, 16 Jan 2017 10:01:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A6CDA2418 for ; Mon, 16 Jan 2017 10:01:39 +0000 (UTC) From: "Michael Haubenwallner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Haubenwallner" Message-ID: <1484560838.077e60fb9c46247fc053df29b9416b46c90ae6c7.haubi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/multiprocessing.eclass X-VCS-Directories: eclass/ X-VCS-Committer: haubi X-VCS-Committer-Name: Michael Haubenwallner X-VCS-Revision: 077e60fb9c46247fc053df29b9416b46c90ae6c7 X-VCS-Branch: master Date: Mon, 16 Jan 2017 10:01:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2d20f0d8-ba6e-42e8-8081-a8a89d182106 X-Archives-Hash: a6f7f40e2562038d8c70a3bd7237f6f4 commit: 077e60fb9c46247fc053df29b9416b46c90ae6c7 Author: Michael Haubenwallner ssi-schaefer com> AuthorDate: Wed Apr 27 15:21:52 2016 +0000 Commit: Michael Haubenwallner gentoo org> CommitDate: Mon Jan 16 10:00:38 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=077e60fb multiprocessing.eclass: work around Cygwin FIFO shortcoming Cygwin does not support multiple read-handles for one FIFO (yet). As we really need just one readonly- and one writeonly-handle, we can reorder to open one single readwrite- and one writeonly-handle. X-Gentoo-Bug: 583962 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=583962 eclass/multiprocessing.eclass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass index 70ca475..67f7e2d 100644 --- a/eclass/multiprocessing.eclass +++ b/eclass/multiprocessing.eclass @@ -139,11 +139,16 @@ multijob_init() { # Setup a pipe for children to write their pids to when they finish. # We have to allocate two fd's because POSIX has undefined behavior - # when you open a FIFO for simultaneous read/write. #487056 + # when using one single fd for both read and write. #487056 + # However, opening an fd for read or write only will block until the + # opposite end is opened as well. Thus we open the first fd for both + # read and write to not block ourselve, but use it for reading only. + # The second fd really is opened for write only, as Cygwin supports + # just one single read fd per FIFO. #583962 local pipe="${T}/multijob.pipe" mkfifo -m 600 "${pipe}" - redirect_alloc_fd mj_write_fd "${pipe}" redirect_alloc_fd mj_read_fd "${pipe}" + redirect_alloc_fd mj_write_fd "${pipe}" '>' rm -f "${pipe}" # See how many children we can fork based on the user's settings.