* hitting control-c (causing SIGINTR) would cause the SIGINTR handler to
be called. it'd cleanup() then exit(). however, cleanup() is scheduled to run at exit via atexit(). This means that it gets run twice, and this causes confusion for things like endwin(). The end result is that rather than actually exiting and printing the "sysinst terminated" message, after one control-c it looks like it's still sitting at the last screen you were viewing even though it's actually at a shell prompt. squelch the cleanup() in the SIGINTR handler to avoid this problem. * while here, nuke the annoying space before the "sysinst terminated." message. it looks bad, and serves no purpose.
This commit is contained in:
parent
1c949badf4
commit
bf0ffa5211
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: main.c,v 1.13 1999/04/09 10:24:38 bouyer Exp $ */
|
/* $NetBSD: main.c,v 1.14 1999/06/18 08:54:28 cgd Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 1997 Piermont Information Systems Inc.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
|
@ -158,8 +158,10 @@ inthandler(notused)
|
||||||
int notused;
|
int notused;
|
||||||
{
|
{
|
||||||
|
|
||||||
/* atexit() wants a void function, so inthandler() just calls cleanup */
|
/*
|
||||||
cleanup();
|
* we need to cleanup(), but it was already scheduled with atexit(),
|
||||||
|
* so it'll be invoked on exit().
|
||||||
|
*/
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +186,7 @@ cleanup()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!exit_cleanly)
|
if (!exit_cleanly)
|
||||||
fprintf(stderr, "\n\n sysinst terminated.\n");
|
fprintf(stderr, "\n\nsysinst terminated.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue