]> git.ozlabs.org Git - ppp.git/blobdiff - chat/chat.c
add debugging messages about waiting for children at exit
[ppp.git] / chat / chat.c
index 90dcc5be837cac3787c77d9fc5fe66c1bd858699..5ce1336e381329afb811bb71e209efd840ade535 100644 (file)
@@ -78,7 +78,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: chat.c,v 1.18 1998/02/04 01:35:49 paulus Exp $";
+static char rcsid[] = "$Id: chat.c,v 1.20 1999/03/31 12:28:16 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -606,6 +606,11 @@ void break_sequence()
 void terminate(status)
 int status;
 {
+    static int terminating = 0;
+
+    if (terminating)
+       exit(status);
+    terminating = 1;
     echo_stderr(-1);
     if (report_file != (char *) 0 && report_fp != (FILE *) NULL) {
 /*
@@ -1414,6 +1419,16 @@ register char *string;
     return (0);
 }
 
+/*
+ * Gross kludge to handle Solaris versions >= 2.6 having usleep.
+ */
+#ifdef SOL2
+#include <sys/param.h>
+#if MAXUID > 65536             /* then this is Solaris 2.6 or later */
+#undef NO_USLEEP
+#endif
+#endif /* SOL2 */
+
 #ifdef NO_USLEEP
 #include <sys/types.h>
 #include <sys/time.h>