bug-bash
[Top][All Lists]
Advanced

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

Re: [BUG] Bash not reacting to Ctrl-C


From: Bob Proulx
Subject: Re: [BUG] Bash not reacting to Ctrl-C
Date: Wed, 9 Feb 2011 14:39:13 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

Oleg Nesterov wrote:
> That is why I provided another test-case, let me repeat it:

Sorry but I missed seeing that the first time through or I would have
commented.

>       #!./bash
>       perl -we '$SIG{INT} = sub {exit}; sleep'
>       echo "Hehe, I am going to sleep after ^C"
>       sleep 100

This test case is flawed in that as written perl will eat the signal
and ignore it.  It isn't fair to explicitly ignore the signal.

Instead try this improved test case with corrected signal handling.

  #!/bin/bash
  perl -we '$SIG{INT}=sub{$SIG{INT}="DEFAULT";kill(INT,$$);}; sleep' || exit 1
  echo "Hehe, I am going to sleep after ^C"
  sleep 100
  exit(0);

Does this get interrupted after one SIGINT now that it isn't being
caught and ignored?

To be clear I am simply trying to make sure the test cases are not
themselves creating the problem.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]