[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: case of printf >fifo hang in int trap
From: |
Chet Ramey |
Subject: |
Re: case of printf >fifo hang in int trap |
Date: |
Mon, 14 Feb 2022 16:37:30 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 |
On 2/13/22 1:33 PM, Alex fxmbsw7 Ratchev wrote:
it hangs, further control-c dont take action, control-z maybe in scripts in
interactive not
so i have, mkfifo fifo ; trap 'printf nowork>fifo' int, it hangs on it, in
interactive the whole even makes all three key combos i know nowork,
control c and z and \
test:
mkfifo ${a:=/tmp/afifo}
trap 'printf hang >$a' int
first control-c is run, the rest is hanging, displaying ^C and ^\ and ^Z
but nothing happens
OK. What do you expect to happen?
The second SIGINT interrupts the open that gets run by the trap handler
for the first SIGINT (which hangs until someone opens the FIFO for
reading), but the signal remains trapped. You're just going to keep
trying to open the FIFO and write something to it every time you hit ^C,
which seems fairly pointless.
The SIGQUIT is always ignored.
There's no external process created, so the SIGTSTP has no effect.
In fact, the whole exercise, starting with trying to open a FIFO from a
trap handler without opening it for reading, seems pointless or worse.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/