Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst * hitting control-c (causing SIGINTR) ...



details:   https://anonhg.NetBSD.org/src/rev/2fb3ec91a282
branches:  trunk
changeset: 473763:2fb3ec91a282
user:      cgd <cgd%NetBSD.org@localhost>
date:      Fri Jun 18 08:54:28 1999 +0000

description:
* 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.

diffstat:

 distrib/utils/sysinst/main.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 6e54ec551c1b -r 2fb3ec91a282 distrib/utils/sysinst/main.c
--- a/distrib/utils/sysinst/main.c      Fri Jun 18 08:17:50 1999 +0000
+++ b/distrib/utils/sysinst/main.c      Fri Jun 18 08:54:28 1999 +0000
@@ -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.
@@ -158,8 +158,10 @@
        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);
 }
 
@@ -184,7 +186,7 @@
        }
 
        if (!exit_cleanly)
-               fprintf(stderr, "\n\n sysinst terminated.\n");
+               fprintf(stderr, "\n\nsysinst terminated.\n");
 }
 
 



Home | Main Index | Thread Index | Old Index