From mint-bounce@lists.fishpool.fi  Fri Jul 16 05:06:13 2010
X-Virus-Scanned: amavisd-new at demon.co.uk
Subject: Re: [MiNT] read() and signals
From: Alan Hourihane <alanh@fairlite.co.uk>
To: Vincent =?ISO-8859-1?Q?Rivi=E8re?= <vincent.riviere@freesbee.fr>
Cc: mint@lists.fishpool.fi
In-Reply-To: <4C39FD60.7040409@freesbee.fr>
References: <4C389D1D.7030108@freesbee.fr>
	 <1278789068.7311.1378.camel@jetpack.demon.co.uk>
	 <4C39FD60.7040409@freesbee.fr>
Content-Type: text/plain; charset="ISO-8859-1"
Date: Fri, 16 Jul 2010 10:03:18 +0100
Message-ID: <1279270998.26377.1077.camel@jetpack.demon.co.uk>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3.1 
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: alanh@fairlite.co.uk
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id o6G96CS8001562

On Sun, 2010-07-11 at 19:20 +0200, Vincent Rivière wrote:
> Alan Hourihane wrote:
> >> The Ctrl+C keystroke requires to press Enter to do its job, it may be related.
> >> Alan, by chance, have you investigated this issue ?
> >
> > I've seen the same problem, but not investigated yet.
> 
> I had a look at it, and I think I have found the cause of the bash problem.
> Basically, the read() function should fail with EINTR when a signal is 
> caught, but in MiNT it continues blocking.
> 
> The attached program is a very simple testcase.
> 
> On Linux and Cygwin, I get:
> $ ./mysig
> Please type ^C
> ^CSIGINT!
> ret = -1, errno = 4, msg = Interrupted system call
> 
> But on MiNT, I can type ^C several times, it does not exit:
> $ ./mysig
> Please type ^C
> SIGINT!
> SIGINT!
> SIGINT!
> SIGINT!
> 
> However it exits if I type a standard key, of course.
> 
> I don't know if the problem comes from the kernel or the MiNTLib.

Remember that bash 3.2 didn't have this problem, so it'd be worth
investigating what changed.

Alan.


