[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trap ... INT when exec <fifo
From: |
Basin Ilya |
Subject: |
trap ... INT when exec <fifo |
Date: |
Mon, 19 Oct 2015 12:06:36 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
Hi list.
An attempt to open a named pipe created with mkfifo cannot be
interrupted with SIGINT, if trap ... INT installed.
(reading from an opened fifo is interruptible and similar attempt to
open a /dev/tcp socket is interruptible too)
#!/bin/bash
set -e
function errtrap { es=$?; echo "ERROR line $1: Command
exited with status $es.">&2; }; trap 'errtrap $LINENO' ERR
rm -f thefifo
mkfifo thefifo
trap 'echo cleanup' INT
echo "opening thefifo...";
exec 4<thefifo
#exec 4>/dev/tcp/1.2.3.4/445
echo "opened";
echo "reading...";
read <&4
echo done
Bash version 4.3.42, Arch64.
Cannot reproduce in 4.2.46 on Centos7.
- trap ... INT when exec <fifo,
Basin Ilya <=