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

Re: My favorite pet bug (2004): Yum mishandles Ctrl-C



On Thu, 2006-08-31 at 10:47 -0400, Matthew Miller wrote:
> On Thu, Aug 31, 2006 at 04:48:36PM +0300, Gilboa Davara wrote:
> > > This has been considered a feature by a fair number of users.
> > I don't doubt it.
> > Buy why use Ctrl-C?
> > It's like using the "X" button on a gnome WM decoration to maximize the
> > Window.  It simpley makes no sense.
> 
> To you, perhaps. However, this sort of thing is fairly traditional behavior
> in many unix programs -- stop what you're doing without killing the program.
> 
> Try this: run "bc", and type:
> 
>   while (1) print "looping\n"
> 
> and hit enter. Then, hit ctrl-c.
> 

Umm... bc does stop the current execution.
More-ever, convert your code to C, and it will immediately quit.

"
#include <stdio.h>
#include <stdlib.h>

int main(int cArgc, char *szArgv[])
{
        while ( 1 )
            printf("Loooooooping\n");
        return 99;
}
"

(The default signal handler does exit(130) when Ctrl-C is signaled)


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