lua-users home
lua-l archive

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


On Thu, May 16, 2013 at 11:06 PM, Andres Perera <andres.p@zoho.com> wrote:
> On Tue, May 14, 2013 at 9:45 AM, Luiz Henrique de Figueiredo
> <lhf@tecgraf.puc-rio.br> 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