$OpenBSD: patch-src_main_c,v 1.3 2006/06/27 17:32:26 fgsch Exp $
--- src/main.c.orig	Thu Jun 15 17:21:21 2006
+++ src/main.c	Thu Jun 15 17:21:47 2006
@@ -86,6 +86,8 @@ char *opt_away_arg = NULL;
 int opt_debug = 0;
 
 #if HAVE_SIGNAL_H
+int real_status;
+
 /*
  * Lists of signals we wish to catch and those we wish to ignore.
  * Each list terminated with -1
@@ -325,6 +327,8 @@ clean_pid(void)
 	do {
 		pid = waitpid(-1, &status, WNOHANG);
 	} while (pid != 0 && pid != (pid_t)-1);
+
+	real_status = status;
 
 	if ((pid == (pid_t) - 1) && (errno != ECHILD)) {
 		char errmsg[BUFSIZ];
