$NetBSD$

--- stunnel.c.orig	Sat Aug 30 06:34:57 2003
+++ stunnel.c
@@ -74,7 +74,8 @@
 #ifndef USE_WIN32
 static void sigchld_handler(int);
 static void signal_handler(int);
-static int signal_pipe[2];
+/* Cannot be static, used in sthreads.c */
+int signal_pipe[2];
 static char signal_buffer[16];
 #else
 static BOOL CtrlHandler(DWORD);
@@ -633,23 +634,23 @@
 
 #ifdef HAVE_WAIT_FOR_PID
     while((pid=wait_for_pid(-1, &status, WNOHANG))>0) {
-        option.clients--; /* one client less */
+        options.clients--; /* one client less */
 #else
         if((pid=wait(&status))>0) {
-            option.clients--; /* one client less */
+            options.clients--; /* one client less */
 #endif
 #ifdef WIFSIGNALED
         if(WIFSIGNALED(status)) {
             log(LOG_DEBUG, "Process %d terminated on signal %d (%d left)",
-                pid, WTERMSIG(status), num_clients);
+                pid, WTERMSIG(status), options.clients);
         } else {
             log(LOG_DEBUG, "Process %d finished with code %d (%d left)",
-                pid, WEXITSTATUS(status), num_clients);
+                pid, WEXITSTATUS(status), options.clients);
         }
     }
 #else
         log(LOG_DEBUG, "Process %d finished with code %d (%d left)",
-            pid, status, num_clients);
+            pid, status, options.clients);
     }
 #endif
 }
