[Top][All Lists]

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

Re: [Nano-devel] interrupting an open() does not work with gcc

From: Brand Huntsman
Subject: Re: [Nano-devel] interrupting an open() does not work with gcc
Date: Thu, 23 May 2019 06:26:10 -0600

On Thu, 23 May 2019 11:28:04 +0200
Benno Schulenberg <address@hidden> wrote:

> Op 17-05-19 om 08:48 schreef Brand Huntsman:
> > That SIGINT code will enable ^C when reading and maybe also
> > writing, but I couldn't get it to work with opening, it segfaults
> > inside open(). It should be possible because open() can return
> > EINTR if interrupted.  
> With attached demo patch, ^C will interrupt the open() call for me,
> *when* I use clang or tcc as compiler.  But with gcc... nothing
> happens.  :|

newaction.sa_handler = noop;
newaction.sa_flags = 0;

The patch segfaults without the sa_flags line, because it contains garbage. ^C 
now works fine in gcc 8.3 when properly set to zero.

It might be a good idea to zero the flags for other code that uses sigaction().

reply via email to

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