From 3292bde924b9316e108ec435e6a5215dbaf5dcc3 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 4 Jan 2011 01:39:30 +0000 Subject: [PATCH] Opening a FIFO end is supposed to block until the other end is opened, too. So we need a little work-around to open both ends in the shell process to avoid blocking. Apparently Haiku's FIFO implementation isn't quite conforming yet. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40100 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/scripts/build_haiku_image | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build/scripts/build_haiku_image b/build/scripts/build_haiku_image index 0b341d6421..b9f3bc69c3 100755 --- a/build/scripts/build_haiku_image +++ b/build/scripts/build_haiku_image @@ -84,10 +84,14 @@ elif [ $isImage ]; then # Open the FIFOs such that they are ready for the fsShellCommand. This # also makes sure that they remain open until this script exits. When we # exit while the FS shell is still running and waiting for commands, - # closing of our file descriptors will break the pipes and the FS shell + # closing of our file descriptors will break the FIFOs and the FS shell # will exit, too. - exec 3<$fromFSShellFifo 4>$toFSShellFifo 5<$toFSShellFifo \ - 6>$fromFSShellFifo + # Note: A bit of trickery is needed since opening one end blocks until + # someone opens the other end. + sleep 3<$fromFSShellFifo 1 & + exec 6>$fromFSShellFifo 3<$fromFSShellFifo + sleep 5<$toFSShellFifo 1 & + exec 4>$toFSShellFifo 5<$toFSShellFifo # Remove the FIFO files again -- we have the open FDs, so they can # still be used and this makes sure they won't hang around any further.