Subject: Improved Linux Patch for inn 1.4unoff4
From: Roland Alder <[email-masked]>
To: [email-masked]
Date: Sat, 5 Oct 1996 18:06:13 +0200

Jonathan I. Kamens <[email-masked]> has submited a patch for inn at
Thu, 19 Sep 1996 08:10:35 -0400.

His Patch cannot applied without problems, so i have created a new diff
that can applied successfully.

The patches below do three things.  The first one is generic to all
platforms; the others are Linux-specific:

* "clibrary.h" uses macros (in particular, the FD_* macros) which are
  defined in the <sys/time.h> header file.  If <sys/time.h> isn't
  included before "clibrary.h", it'll assume that those macros aren't
  defined by the system and define them itself, but it will in some
  cases get them wrong.

  Therefore, I moved the inclusion of <time.h> and <sys/time.h> from
  all of the places it was scattered into one place -- the top of
  "clibrary.h".

* On Linux, read "/proc/loadavg" to get the Load average.

diff --unified --recursive inn1.4unoff4.orig/backends/archive.c inn1.4unoff4/backends/archive.c
--- inn1.4unoff4.orig/backends/archive.c	Thu Mar 18 22:03:21 1993
+++ inn1.4unoff4/backends/archive.c	Sun Sep 29 22:41:39 1996
@@ -8,10 +8,6 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include "paths.h"
 #include "libinn.h"
 #include "qio.h"
diff --unified --recursive inn1.4unoff4.orig/backends/batcher.c inn1.4unoff4/backends/batcher.c
--- inn1.4unoff4.orig/backends/batcher.c	Thu Mar 18 22:03:24 1993
+++ inn1.4unoff4/backends/batcher.c	Sun Sep 29 22:41:39 1996
@@ -10,10 +10,6 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include "paths.h"
 #include "libinn.h"
 #include "logging.h"
diff --unified --recursive inn1.4unoff4.orig/backends/cvtbatch.c inn1.4unoff4/backends/cvtbatch.c
--- inn1.4unoff4.orig/backends/cvtbatch.c	Mon Feb  1 16:30:11 1993
+++ inn1.4unoff4/backends/cvtbatch.c	Sun Sep 29 22:41:39 1996
@@ -7,10 +7,6 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include "paths.h"
 #include "qio.h"
 #include "libinn.h"
diff --unified --recursive inn1.4unoff4.orig/backends/innxmit.c inn1.4unoff4/backends/innxmit.c
--- inn1.4unoff4.orig/backends/innxmit.c	Wed Feb 28 15:19:06 1996
+++ inn1.4unoff4/backends/innxmit.c	Sun Sep 29 22:41:39 1996
@@ -13,10 +13,6 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <sys/uio.h>
 #include "nntp.h"
 #include "paths.h"
diff --unified --recursive inn1.4unoff4.orig/backends/nntpget.c inn1.4unoff4/backends/nntpget.c
--- inn1.4unoff4.orig/backends/nntpget.c	Thu Mar 18 22:03:29 1993
+++ inn1.4unoff4/backends/nntpget.c	Sun Sep 29 22:41:39 1996
@@ -9,10 +9,6 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <errno.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <sys/uio.h>
 #include "paths.h"
 #include "clibrary.h"
diff --unified --recursive inn1.4unoff4.orig/expire/convdate.c inn1.4unoff4/expire/convdate.c
--- inn1.4unoff4.orig/expire/convdate.c	Fri Jan 29 17:43:18 1993
+++ inn1.4unoff4/expire/convdate.c	Sun Sep 29 22:41:39 1996
@@ -7,10 +7,6 @@
 #include <ctype.h>
 #include <errno.h>
 #include <sys/types.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include "libinn.h"
 #include "clibrary.h"
 #include "macros.h"
diff --unified --recursive inn1.4unoff4.orig/expire/expire.c inn1.4unoff4/expire/expire.c
--- inn1.4unoff4.orig/expire/expire.c	Fri Jan 12 19:48:02 1996
+++ inn1.4unoff4/expire/expire.c	Sun Sep 29 22:41:39 1996
@@ -7,10 +7,6 @@
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <errno.h>
 #include "paths.h"
 #include "libinn.h"
diff --unified --recursive inn1.4unoff4.orig/expire/grephistory.c inn1.4unoff4/expire/grephistory.c
--- inn1.4unoff4.orig/expire/grephistory.c	Fri Jan 29 17:43:26 1993
+++ inn1.4unoff4/expire/grephistory.c	Sun Sep 29 22:41:39 1996
@@ -7,10 +7,6 @@
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <errno.h>
 #include "paths.h"
 #include "libinn.h"
diff --unified --recursive inn1.4unoff4.orig/expire/makehistory.c inn1.4unoff4/expire/makehistory.c
--- inn1.4unoff4.orig/expire/makehistory.c	Mon Jul 31 21:18:46 1995
+++ inn1.4unoff4/expire/makehistory.c	Sun Sep 29 22:41:39 1996
@@ -7,10 +7,6 @@
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <errno.h>
 #include "paths.h"
 #include "libinn.h"
diff --unified --recursive inn1.4unoff4.orig/expire/newsrequeue.c inn1.4unoff4/expire/newsrequeue.c
--- inn1.4unoff4.orig/expire/newsrequeue.c	Wed Jun 14 00:23:07 1995
+++ inn1.4unoff4/expire/newsrequeue.c	Sun Sep 29 22:41:39 1996
@@ -7,10 +7,6 @@
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <errno.h>
 #include "paths.h"
 #include "libinn.h"
diff --unified --recursive inn1.4unoff4.orig/frontends/inews.c inn1.4unoff4/frontends/inews.c
--- inn1.4unoff4.orig/frontends/inews.c	Fri Mar  1 18:07:36 1996
+++ inn1.4unoff4/frontends/inews.c	Sun Sep 29 22:41:39 1996
@@ -11,10 +11,6 @@
 #include <sys/stat.h>
 #include <pwd.h>
 #include <grp.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <fcntl.h>
 #include "nntp.h"
 #include "paths.h"
diff --unified --recursive inn1.4unoff4.orig/frontends/rnews.c inn1.4unoff4/frontends/rnews.c
--- inn1.4unoff4.orig/frontends/rnews.c	Mon Aug  7 19:39:37 1995
+++ inn1.4unoff4/frontends/rnews.c	Sun Sep 29 22:41:39 1996
@@ -9,10 +9,6 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <errno.h>
diff --unified --recursive inn1.4unoff4.orig/include/clibrary.h inn1.4unoff4/include/clibrary.h
--- inn1.4unoff4.orig/include/clibrary.h	Thu Mar 18 22:04:07 1993
+++ inn1.4unoff4/include/clibrary.h	Sun Sep 29 22:42:21 1996
@@ -4,9 +4,14 @@
 **  You must #include <sys/types.h> and <stdio.h> before this file.
 */
 
+#if	defined(DO_NEED_TIME)
+#include <time.h>
+#endif	/* defined(DO_NEED_TIME) */
+#include <sys/time.h>
+
 #if	defined(DO_HAVE_UNISTD)
 #include <unistd.h>
-#endif	/* defined(DO_HAVE_UNISTD) */
+#endif  /* defined(DO_HAVE_UNISTD) */
 
 #if	defined(DO_HAVE_VFORK)
 #include <vfork.h>
diff --unified --recursive inn1.4unoff4.orig/innd/innd.h inn1.4unoff4/innd/innd.h
--- inn1.4unoff4.orig/innd/innd.h	Tue Feb 27 20:13:36 1996
+++ inn1.4unoff4/innd/innd.h	Sun Sep 29 22:43:22 1996
@@ -28,10 +28,6 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <fcntl.h>
diff --unified --recursive inn1.4unoff4.orig/innd/inndstart.c inn1.4unoff4/innd/inndstart.c
--- inn1.4unoff4.orig/innd/inndstart.c	Thu Mar 18 22:04:26 1993
+++ inn1.4unoff4/innd/inndstart.c	Sun Sep 29 22:41:39 1996
@@ -15,10 +15,6 @@
 #include "clibrary.h"
 #include "macros.h"
 #if	NOFILE_LIMIT > 0
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <sys/resource.h>
 #endif	/* NOFILE_LIMIT > 0 */
 
diff --unified --recursive inn1.4unoff4.orig/lib/inndcomm.c inn1.4unoff4/lib/inndcomm.c
--- inn1.4unoff4.orig/lib/inndcomm.c	Thu Mar 18 22:04:36 1993
+++ inn1.4unoff4/lib/inndcomm.c	Sun Sep 29 22:41:39 1996
@@ -9,10 +9,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if	defined(DO_NEED_TIME)
-#include <time.h>
-#endif	/* defined(DO_NEED_TIME) */
-#include <sys/time.h>
 #include <sys/socket.h>
 #if	defined(DO_HAVE_UNIX_DOMAIN)
 #include <sys/un.h>