1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

package.sh: clean up FIFO properly (re: 936802f9)

Not cleaning up the FIFO broke 'grep -r' in the arch directory,
making it hang forever. So we need a better way of cleaning it up.

bin/package,
src/cmd/INIT/package.sh:
- Unlink the FIFO early after sleeping a second in the background.
  This works because the named directory entry is only needed to
  establish the pipe, not to keep it going.
This commit is contained in:
Martijn Dekker 2020-06-30 04:45:02 +02:00
parent 8d8a825723
commit 3e14072768
2 changed files with 10 additions and 0 deletions

View file

@ -3973,6 +3973,11 @@ capture() # file command ...
# the main shell environment and its exit status can be used for $error_status # the main shell environment and its exit status can be used for $error_status
rm -f $o.fifo rm -f $o.fifo
mkfifo -m 600 $o.fifo || exit mkfifo -m 600 $o.fifo || exit
(
sleep 1
# unlink early
exec rm $o.fifo
) &
$TEE -a $o < $o.fifo & $TEE -a $o < $o.fifo &
{ {
case $s in case $s in

View file

@ -3972,6 +3972,11 @@ capture() # file command ...
# the main shell environment and its exit status can be used for $error_status # the main shell environment and its exit status can be used for $error_status
rm -f $o.fifo rm -f $o.fifo
mkfifo -m 600 $o.fifo || exit mkfifo -m 600 $o.fifo || exit
(
sleep 1
# unlink early
exec rm $o.fifo
) &
$TEE -a $o < $o.fifo & $TEE -a $o < $o.fifo &
{ {
case $s in case $s in