Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11702

trap ... INT when exec <fifo

From Basin Ilya <basinilya@gmail.com>
Newsgroups gnu.bash.bug
Subject trap ... INT when exec <fifo
Date 2015-10-19 12:06 +0200
Message-ID <mailman.625.1445249208.7904.bug-bash@gnu.org> (permalink)

Show all headers | View raw


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.

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

trap ... INT when exec <fifo Basin Ilya <basinilya@gmail.com> - 2015-10-19 12:06 +0200

csiph-web