* krlogin.c (doit): use exit_handler for signal exits, don't use
authorMark Eichin <eichin@mit.edu>
Wed, 11 Jan 1995 00:44:56 +0000 (00:44 +0000)
committerMark Eichin <eichin@mit.edu>
Wed, 11 Jan 1995 00:44:56 +0000 (00:44 +0000)
exit directly.
(exit_handler): new function, avoids type collision from misusing
exit directly as a signal handler.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4803 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/krlogin.c

index 59f82b62b0b5664213542fc9789c7cd821f13e9c..fad183171b53baa0540008b216b266901259bc01 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jan 10 19:43:18 1995  Mark Eichin  (eichin@cygnus.com)
+
+       * krlogin.c (doit): use exit_handler for signal exits, don't use
+       exit directly.
+       (exit_handler): new function, avoids type collision from misusing
+       exit directly as a signal handler.
+
 Tue Jan 10 15:23:31 1995  Richard Basch  (probe@tardis)
 
        * configure.in: Streams test needs to include sys/types.h
index d48e98133a43c9264c4585a9085dd66c942141ab..b601b5f4fc5d23f3a8beb10f87a3a957172f12d2 100644 (file)
@@ -168,7 +168,6 @@ struct sockaddr_in local, foreign;
 struct termios deftty;
 #endif
 
-krb5_sigtype exit();
 char   *getenv();
 
 char   *name;
@@ -223,6 +222,12 @@ krb5_sigtype       lostpeer();
 int setsignal(int sig, krb5_sigtype (*act)());
 #endif
 
+/* to allow exits from signal handlers, without conflicting declarations */
+krb5_sigtype exit_handler() {
+  exit(1);
+}
+
+
 /*
  * The following routine provides compatibility (such as it is)
  * between 4.2BSD Suns and others.  Suns have only a `ttysize',
@@ -774,8 +779,8 @@ doit(oldmask)
     (void) signal(SIGINT, SIG_IGN);
 #endif
 
-    setsignal(SIGHUP, exit);
-    setsignal(SIGQUIT, exit);
+    setsignal(SIGHUP, exit_handler);
+    setsignal(SIGQUIT, exit_handler);
 
     child = fork();
     if (child == -1) {