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.

Reply via email to