nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Patch to files.c


From: David Benbennick
Subject: Re: [Nano-devel] Patch to files.c
Date: Wed, 27 Mar 2002 03:18:16 -0500 (EST)

On Tue, 26 Mar 2002, Chris Allegretta wrote:

> > Second idea: before doing "wait(&fork_status);" in open_pipe(), change the
> > SIGINT action from SIG_IGN to a routine that kills the fork.  Thus, typing
> > ^C will unfreeze nano in that case.
> 
> I like this.  Anyone who is silly enough to do this is immediately going 
> to try and hit ^C anyway when nano hangs, so let's accomodate that
> tendency.  If someone hasn't written the code before tonight I'll have a 
> go at it.  

Here is the patch.  I had to create a global variable
        cc_t backup_intr_char
to record what the interrupt character was initially, since nano turns it
off in main().

I also took the opportunity to create an nperror wrapper function for
perror.  Builds character to check system call return values.  Perhaps the
contents of nperror should be wrapped in #ifdef DEBUG.


I wonder if we could make a similar ^C feature when loading or writing a
file.  I guess that would take more work, since it would need the
cooperation of the file-loading code.  The signal handler would merely set
a CANCEL_ACTION flag, and periodically the read or write code would
examine the flag, and stop if it was set.


David

Attachment: 27mar02:50.diff
Description: Text document


reply via email to

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