File fix_includes.patch of Package netqmail

Index: auto-gid.c
===================================================================
--- auto-gid.c.orig
+++ auto-gid.c
@@ -2,7 +2,7 @@
 #include <grp.h>
 #include "subfd.h"
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "scan.h"
 #include "fmt.h"
Index: auto-int.c
===================================================================
--- auto-int.c.orig
+++ auto-int.c
@@ -1,5 +1,5 @@
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "scan.h"
 #include "fmt.h"
Index: auto-int8.c
===================================================================
--- auto-int8.c.orig
+++ auto-int8.c
@@ -1,5 +1,5 @@
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "scan.h"
 #include "fmt.h"
Index: auto-str.c
===================================================================
--- auto-str.c.orig
+++ auto-str.c
@@ -1,5 +1,5 @@
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 
 char buf1[256];
Index: auto-uid.c
===================================================================
--- auto-uid.c.orig
+++ auto-uid.c
@@ -2,7 +2,7 @@
 #include <pwd.h>
 #include "subfd.h"
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "scan.h"
 #include "fmt.h"
Index: cdbmss.c
===================================================================
--- cdbmss.c.orig
+++ cdbmss.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
 #include "seek.h"
 #include "alloc.h"
 #include "cdbmss.h"
Index: condredirect.c
===================================================================
--- condredirect.c.orig
+++ condredirect.c
@@ -1,5 +1,5 @@
 #include "sig.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "env.h"
 #include "error.h"
Index: control.c
===================================================================
--- control.c.orig
+++ control.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
 #include "open.h"
 #include "getln.h"
 #include "stralloc.h"
Index: dnscname.c
===================================================================
--- dnscname.c.orig
+++ dnscname.c
@@ -3,7 +3,7 @@
 #include "stralloc.h"
 #include "dns.h"
 #include "dnsdoe.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 
 stralloc sa = {0};
Index: forward.c
===================================================================
--- forward.c.orig
+++ forward.c
@@ -1,5 +1,5 @@
 #include "sig.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "env.h"
 #include "qmail.h"
Index: hostname.c
===================================================================
--- hostname.c.orig
+++ hostname.c
@@ -1,6 +1,6 @@
 #include "substdio.h"
 #include "subfd.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 
 char host[256];
Index: idedit.c
===================================================================
--- idedit.c.orig
+++ idedit.c
@@ -1,7 +1,7 @@
 #include <sys/types.h>
 #include <pwd.h>
 #include <grp.h>
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "scan.h"
 #include "fmt.h"
Index: install.c
===================================================================
--- install.c.orig
+++ install.c
@@ -1,8 +1,11 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include "substdio.h"
 #include "strerr.h"
 #include "error.h"
 #include "open.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 
 extern void hier();
Index: instcheck.c
===================================================================
--- instcheck.c.orig
+++ instcheck.c
@@ -2,7 +2,7 @@
 #include <sys/stat.h>
 #include "strerr.h"
 #include "error.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 
 extern void hier();
Index: maildir2mbox.c
===================================================================
--- maildir2mbox.c.orig
+++ maildir2mbox.c
@@ -1,4 +1,7 @@
-#include "readwrite.h"
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "prioq.h"
 #include "env.h"
 #include "stralloc.h"
Index: maildirwatch.c
===================================================================
--- maildirwatch.c.orig
+++ maildirwatch.c
@@ -6,7 +6,7 @@
 #include "str.h"
 #include "exit.h"
 #include "hfield.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "open.h"
 #include "headerbody.h"
 #include "maildir.h"
Index: predate.c
===================================================================
--- predate.c.orig
+++ predate.c
@@ -8,7 +8,7 @@
 #include "strerr.h"
 #include "substdio.h"
 #include "subfd.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 
 #define FATAL "predate: fatal: "
Index: preline.c
===================================================================
--- preline.c.orig
+++ preline.c
@@ -1,6 +1,6 @@
 #include "fd.h"
 #include "sgetopt.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "strerr.h"
 #include "substdio.h"
 #include "exit.h"
Index: qbiff.c
===================================================================
--- qbiff.c.orig
+++ qbiff.c
@@ -8,7 +8,7 @@
 #define UTMP_FILE "/etc/utmp"
 #endif
 #endif
-#include "readwrite.h"
+#include <unistd.h>
 #include "stralloc.h"
 #include "substdio.h"
 #include "subfd.h"
Index: qmail-clean.c
===================================================================
--- qmail-clean.c.orig
+++ qmail-clean.c
@@ -1,6 +1,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "readwrite.h"
+#include <unistd.h>
 #include "sig.h"
 #include "now.h"
 #include "str.h"
Index: qmail-getpw.c
===================================================================
--- qmail-getpw.c.orig
+++ qmail-getpw.c
@@ -1,7 +1,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <pwd.h>
-#include "readwrite.h"
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 #include "error.h"
Index: qmail-local.c
===================================================================
--- qmail-local.c.orig
+++ qmail-local.c
@@ -1,6 +1,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "readwrite.h"
+#include <unistd.h>
 #include "sig.h"
 #include "env.h"
 #include "byte.h"
Index: qmail-newmrh.c
===================================================================
--- qmail-newmrh.c.orig
+++ qmail-newmrh.c
@@ -1,9 +1,12 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include "strerr.h"
 #include "stralloc.h"
 #include "substdio.h"
 #include "getln.h"
 #include "exit.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "open.h"
 #include "auto_qmail.h"
 #include "cdbmss.h"
Index: qmail-newu.c
===================================================================
--- qmail-newu.c.orig
+++ qmail-newu.c
@@ -1,10 +1,13 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include "stralloc.h"
 #include "subfd.h"
 #include "getln.h"
 #include "substdio.h"
 #include "cdbmss.h"
 #include "exit.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "open.h"
 #include "error.h"
 #include "case.h"
Index: qmail-popup.c
===================================================================
--- qmail-popup.c.orig
+++ qmail-popup.c
@@ -10,7 +10,7 @@
 #include "now.h"
 #include "fmt.h"
 #include "exit.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "timeoutread.h"
 #include "timeoutwrite.h"
 
Index: qmail-pw2u.c
===================================================================
--- qmail-pw2u.c.orig
+++ qmail-pw2u.c
@@ -1,7 +1,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "subfd.h"
 #include "sgetopt.h"
 #include "control.h"
Index: qmail-qmqpc.c
===================================================================
--- qmail-qmqpc.c.orig
+++ qmail-qmqpc.c
@@ -4,7 +4,7 @@
 #include <arpa/inet.h>
 #include "substdio.h"
 #include "getln.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "stralloc.h"
 #include "slurpclose.h"
Index: qmail-qmqpd.c
===================================================================
--- qmail-qmqpd.c.orig
+++ qmail-qmqpd.c
@@ -3,7 +3,7 @@
 #include "received.h"
 #include "sig.h"
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "exit.h"
 #include "now.h"
 #include "fmt.h"
Index: qmail-qmtpd.c
===================================================================
--- qmail-qmtpd.c.orig
+++ qmail-qmtpd.c
@@ -8,7 +8,7 @@
 #include "sig.h"
 #include "rcpthosts.h"
 #include "auto_qmail.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "control.h"
 #include "received.h"
 
Index: qmail-qread.c
===================================================================
--- qmail-qread.c.orig
+++ qmail-qread.c
@@ -12,7 +12,7 @@
 #include "open.h"
 #include "datetime.h"
 #include "date822fmt.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "error.h"
 #include "exit.h"
 
Index: qmail-queue.c
===================================================================
--- qmail-queue.c.orig
+++ qmail-queue.c
@@ -1,6 +1,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "readwrite.h"
+#include <unistd.h>
 #include "sig.h"
 #include "exit.h"
 #include "open.h"
Index: qmail-remote.c
===================================================================
--- qmail-remote.c.orig
+++ qmail-remote.c
@@ -24,7 +24,7 @@
 #include "exit.h"
 #include "constmap.h"
 #include "tcpto.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "timeoutconn.h"
 #include "timeoutread.h"
 #include "timeoutwrite.h"
Index: qmail-send.c
===================================================================
--- qmail-send.c.orig
+++ qmail-send.c
@@ -1,6 +1,7 @@
+#include <utime.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "readwrite.h"
+#include <unistd.h>
 #include "sig.h"
 #include "direntry.h"
 #include "control.h"
Index: qmail-smtpd.c
===================================================================
--- qmail-smtpd.c.orig
+++ qmail-smtpd.c
@@ -1,5 +1,5 @@
 #include "sig.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "stralloc.h"
 #include "substdio.h"
 #include "alloc.h"
Index: qmail-tcpok.c
===================================================================
--- qmail-tcpok.c.orig
+++ qmail-tcpok.c
@@ -2,7 +2,7 @@
 #include "substdio.h"
 #include "lock.h"
 #include "open.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "auto_qmail.h"
 #include "exit.h"
 
Index: qmail.c
===================================================================
--- qmail.c.orig
+++ qmail.c
@@ -1,5 +1,5 @@
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "wait.h"
 #include "exit.h"
 #include "fork.h"
Index: qsmhook.c
===================================================================
--- qsmhook.c.orig
+++ qsmhook.c
@@ -1,6 +1,6 @@
 #include "fd.h"
 #include "stralloc.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "sgetopt.h"
 #include "wait.h"
 #include "env.h"
Index: qsutil.c
===================================================================
--- qsutil.c.orig
+++ qsutil.c
@@ -1,5 +1,5 @@
 #include "stralloc.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "substdio.h"
 #include "qsutil.h"
 
Index: slurpclose.c
===================================================================
--- slurpclose.c.orig
+++ slurpclose.c
@@ -1,5 +1,5 @@
 #include "stralloc.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "slurpclose.h"
 #include "error.h"
 
Index: subfderr.c
===================================================================
--- subfderr.c.orig
+++ subfderr.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 
Index: subfdin.c
===================================================================
--- subfdin.c.orig
+++ subfdin.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 
Index: subfdins.c
===================================================================
--- subfdins.c.orig
+++ subfdins.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 
Index: subfdout.c
===================================================================
--- subfdout.c.orig
+++ subfdout.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 
Index: subfdouts.c
===================================================================
--- subfdouts.c.orig
+++ subfdouts.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 
Index: tcpto.c
===================================================================
--- tcpto.c.orig
+++ tcpto.c
@@ -6,7 +6,7 @@
 #include "ip.h"
 #include "byte.h"
 #include "datetime.h"
-#include "readwrite.h"
+#include <unistd.h>
 
 char tcpto_buf[1024];
 
Index: tcpto_clean.c
===================================================================
--- tcpto_clean.c.orig
+++ tcpto_clean.c
@@ -1,7 +1,7 @@
 #include "tcpto.h"
 #include "open.h"
 #include "substdio.h"
-#include "readwrite.h"
+#include <unistd.h>
 
 char tcpto_cleanbuf[1024];
 
Index: timeoutconn.c
===================================================================
--- timeoutconn.c.orig
+++ timeoutconn.c
@@ -5,7 +5,7 @@
 #include "ndelay.h"
 #include "select.h"
 #include "error.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "ip.h"
 #include "byte.h"
 #include "timeoutconn.h"
Index: timeoutread.c
===================================================================
--- timeoutread.c.orig
+++ timeoutread.c
@@ -1,7 +1,7 @@
 #include "timeoutread.h"
 #include "select.h"
 #include "error.h"
-#include "readwrite.h"
+#include <unistd.h>
 
 int timeoutread(t,fd,buf,len) int t; int fd; char *buf; int len;
 {
Index: timeoutwrite.c
===================================================================
--- timeoutwrite.c.orig
+++ timeoutwrite.c
@@ -1,7 +1,7 @@
 #include "timeoutwrite.h"
 #include "select.h"
 #include "error.h"
-#include "readwrite.h"
+#include <unistd.h>
 
 int timeoutwrite(t,fd,buf,len) int t; int fd; char *buf; int len;
 {
Index: cdb_seek.c
===================================================================
--- cdb_seek.c.orig
+++ cdb_seek.c
@@ -1,5 +1,6 @@
 #include <sys/types.h>
 #include <errno.h>
+#include <unistd.h>
 #include "cdb.h"
 
 #ifndef SEEK_SET
Index: qmail-tcpto.c
===================================================================
--- qmail-tcpto.c.orig
+++ qmail-tcpto.c
@@ -1,5 +1,6 @@
 /* XXX: this program knows quite a bit about tcpto's internals */
 
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 #include "auto_qmail.h"
Index: spawn.c
===================================================================
--- spawn.c.orig
+++ spawn.c
@@ -1,5 +1,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include "sig.h"
 #include "wait.h"
 #include "substdio.h"
Index: triggerpull.c
===================================================================
--- triggerpull.c.orig
+++ triggerpull.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "ndelay.h"
 #include "open.h"
 #include "triggerpull.h"
Index: seek_cur.c
===================================================================
--- seek_cur.c.orig
+++ seek_cur.c
@@ -1,4 +1,5 @@
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 #define CUR 1 /* sigh */
Index: seek_end.c
===================================================================
--- seek_end.c.orig
+++ seek_end.c
@@ -1,4 +1,5 @@
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 #define END 2 /* sigh */
Index: seek_set.c
===================================================================
--- seek_set.c.orig
+++ seek_set.c
@@ -1,4 +1,5 @@
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 #define SET 0 /* sigh */
Index: alloc.c
===================================================================
--- alloc.c.orig
+++ alloc.c
@@ -1,7 +1,6 @@
+#include <stdlib.h>
 #include "alloc.h"
 #include "error.h"
-extern char *malloc();
-extern void free();
 
 #define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
 #define SPACE 4096 /* must be multiple of ALIGNMENT */
Index: fd_copy.c
===================================================================
--- fd_copy.c.orig
+++ fd_copy.c
@@ -1,4 +1,5 @@
 #include <fcntl.h>
+#include <unistd.h>
 #include "fd.h"
 
 int fd_copy(to,from)
Index: fd_move.c
===================================================================
--- fd_move.c.orig
+++ fd_move.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "fd.h"
 
 int fd_move(to,from)
Index: seek_trunc.c
===================================================================
--- seek_trunc.c.orig
+++ seek_trunc.c
@@ -1,4 +1,5 @@
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 int seek_trunc(fd,pos) int fd; seek_pos pos;
Index: chkshsgr.c
===================================================================
--- chkshsgr.c.orig
+++ chkshsgr.c
@@ -1,4 +1,8 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <grp.h>
 #include "exit.h"
+
 void main()
 {
  short x[4];
Index: qmail-start.c
===================================================================
--- qmail-start.c.orig
+++ qmail-start.c
@@ -1,3 +1,6 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "fd.h"
 #include "prot.h"
 #include "exit.h"
Index: maildirmake.c
===================================================================
--- maildirmake.c.orig
+++ maildirmake.c
@@ -1,3 +1,6 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "strerr.h"
 #include "exit.h"
 
Index: maildir.c
===================================================================
--- maildir.c.orig
+++ maildir.c
@@ -1,5 +1,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include "prioq.h"
 #include "env.h"
 #include "stralloc.h"
Index: qmail-inject.c
===================================================================
--- qmail-inject.c.orig
+++ qmail-inject.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "sig.h"
 #include "substdio.h"
 #include "stralloc.h"
Index: qmail-lspawn.c
===================================================================
--- qmail-lspawn.c.orig
+++ qmail-lspawn.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "fd.h"
 #include "wait.h"
 #include "prot.h"
Index: qmail-showctl.c
===================================================================
--- qmail-showctl.c.orig
+++ qmail-showctl.c
@@ -1,5 +1,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include "substdio.h"
 #include "subfd.h"
 #include "exit.h"
Index: sendmail.c
===================================================================
--- sendmail.c.orig
+++ sendmail.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "sgetopt.h"
 #include "substdio.h"
 #include "subfd.h"
Index: ipme.c
===================================================================
--- ipme.c.orig
+++ ipme.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/time.h>
Index: trigger.c
===================================================================
--- trigger.c.orig
+++ trigger.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "select.h"
 #include "open.h"
 #include "trigger.h"
Index: remoteinfo.c
===================================================================
--- remoteinfo.c.orig
+++ remoteinfo.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
Index: qmail-pop3d.c
===================================================================
--- qmail-pop3d.c.orig
+++ qmail-pop3d.c
@@ -13,7 +13,7 @@
 #include "str.h"
 #include "exit.h"
 #include "maildir.h"
-#include "readwrite.h"
+#include <unistd.h>
 #include "timeoutread.h"
 #include "timeoutwrite.h"
 
Index: bouncesaying.c
===================================================================
--- bouncesaying.c.orig
+++ bouncesaying.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "fork.h"
 #include "strerr.h"
 #include "error.h"
Index: except.c
===================================================================
--- except.c.orig
+++ except.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "fork.h"
 #include "strerr.h"
 #include "wait.h"
Index: prot.c
===================================================================
--- prot.c.orig
+++ prot.c
@@ -1,3 +1,6 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <grp.h>
 #include "hasshsgr.h"
 #include "prot.h"
 
Index: qmail-rspawn.c
===================================================================
--- qmail-rspawn.c.orig
+++ qmail-rspawn.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "fd.h"
 #include "wait.h"
 #include "substdio.h"
Index: tcp-env.c
===================================================================
--- tcp-env.c.orig
+++ tcp-env.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/param.h>