[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Break out of program in interpreter
- From: Andres Perera <andres.p@...>
- Date: Thu, 16 May 2013 23:11:33 -0430
On Thu, May 16, 2013 at 11:06 PM, Andres Perera <firstname.lastname@example.org> wrote:
> On Tue, May 14, 2013 at 9:45 AM, Luiz Henrique de Figueiredo
> <email@example.com> wrote:
>> Bottom line: test the return value of os.execute if you want to handle ^C
>> in forked processes.
> What is the equivalent of WIFSIGNALED() from POSIX <sys/wait.h>?
>> = os.execute("while :; do :; done")
> ^Cnil exit 130
>> = os.execute("exit 130")
> nil exit 130
> There are no means for differentiating using os.execute(), as far as I can see.
Sorry, this was a case where Lua helped diagnosing a crappy system shell:
> = os.execute("exec bash -c 'kill -INT $$'")
nil signal 2