Re: Signal handler not called when trying to open fifo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 26, 2024 at 10:49:36AM +0200, Johannes Altmanninger wrote:
> I'm trying to recover from the state where a fifo reader is
> unexpectedly unavailable.  My idea is to signal the writer process
> after timeout, to avoid it hanging forever:
> 
> 	mkfifo fifo
> 	timeout 1 sh -c 'trap "echo cleanup...; exit" TERM; exec 3>fifo'
> 
> This works when using bash or zsh but with dash my signal handler is never called.

I realized I can work around this using

	timeout sh ...
	if [ $? -eq 124 ]; then cleanup; fi

That works for me.

> Instead I get
> 
> 	sh: 1: cannot create fifo: Interrupted system call
> 
> Is this supposed to work?




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux