summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Mausz <manuel@mausz.at>2019-06-11 15:28:27 +0200
committermanuel <manuel@mausz.at>2019-06-11 15:29:11 +0200
commit692760720b197b46e8e4268bede8cad6f90399aa (patch)
tree0d0d5f45759b83e15d6668357f9482dca236880b
parent54bb1142daa7c25f626176bb9357e1fc7ca75fbb (diff)
downloadqmail-692760720b197b46e8e4268bede8cad6f90399aa.tar.gz
qmail-692760720b197b46e8e4268bede8cad6f90399aa.tar.bz2
qmail-692760720b197b46e8e4268bede8cad6f90399aa.zip
Fix compile warnings...
-rw-r--r--.gitignore1
-rw-r--r--auto-gid.c2
-rw-r--r--auto-int.c2
-rw-r--r--auto-int8.c2
-rw-r--r--auto-str.c2
-rw-r--r--auto-uid.c2
-rw-r--r--bouncesaying.c1
-rw-r--r--cdb_seek.c1
-rw-r--r--cdbmss.c3
-rw-r--r--cdbmss.h4
-rw-r--r--chkshsgr.c6
-rw-r--r--condredirect.c4
-rw-r--r--control.c2
-rw-r--r--dnscname.c2
-rw-r--r--dnsmxip.c1
-rw-r--r--except.c1
-rw-r--r--fd_copy.c1
-rw-r--r--fd_move.c1
-rw-r--r--forward.c4
-rw-r--r--hostname.c2
-rw-r--r--idedit.c3
-rw-r--r--install.c4
-rw-r--r--instcheck.c2
-rw-r--r--ipme.c1
-rw-r--r--maildir.c1
-rw-r--r--maildir2mbox.c5
-rw-r--r--maildirgetquota.c2
-rw-r--r--maildirmake.c3
-rw-r--r--maildirmisc.h2
-rw-r--r--maildiropen.c2
-rw-r--r--maildirquota.c6
-rw-r--r--maildirwatch.c2
-rw-r--r--newfield.c1
-rw-r--r--overmaildirquota.c11
-rw-r--r--predate.c3
-rw-r--r--preline.c2
-rw-r--r--prot.c3
-rw-r--r--qbiff.c2
-rw-r--r--qmail-clean.c2
-rw-r--r--qmail-getpw.c2
-rw-r--r--qmail-inject.c1
-rw-r--r--qmail-local.c4
-rw-r--r--qmail-lspawn.c3
-rw-r--r--qmail-newbrt.c6
-rw-r--r--qmail-newmrh.c6
-rw-r--r--qmail-newu.c6
-rw-r--r--qmail-pop3d.c11
-rw-r--r--qmail-popup.c10
-rw-r--r--qmail-pw2u.c3
-rw-r--r--qmail-qmqpc.c13
-rw-r--r--qmail-qmqpd.c15
-rw-r--r--qmail-qmtpd.c14
-rw-r--r--qmail-qread.c2
-rw-r--r--qmail-queue.c2
-rw-r--r--qmail-remote.c10
-rw-r--r--qmail-rspawn.c1
-rw-r--r--qmail-send.c9
-rw-r--r--qmail-showctl.c1
-rw-r--r--qmail-smtpd.c11
-rw-r--r--qmail-spp.c2
-rw-r--r--qmail-start.c3
-rw-r--r--qmail-tcpok.c2
-rw-r--r--qmail-tcpto.c3
-rw-r--r--qmail.c2
-rw-r--r--qsmhook.c2
-rw-r--r--qsutil.c2
-rw-r--r--rcpthosts.c1
-rw-r--r--realrcptto.c24
-rw-r--r--remoteinfo.c1
-rw-r--r--scan.h1
-rw-r--r--seek_cur.c1
-rw-r--r--seek_end.c1
-rw-r--r--seek_set.c1
-rw-r--r--seek_trunc.c1
-rw-r--r--sendmail.c2
-rw-r--r--slurpclose.c2
-rw-r--r--spawn.c1
-rw-r--r--subfd.h4
-rw-r--r--subfderr.c2
-rw-r--r--subfdin.c4
-rw-r--r--subfdins.c4
-rw-r--r--subfdout.c2
-rw-r--r--subfdouts.c2
-rw-r--r--substdio.c2
-rw-r--r--substdio.h4
-rw-r--r--tcp-env.c1
-rw-r--r--tcpto.c2
-rw-r--r--tcpto_clean.c2
-rw-r--r--timeoutconn.c2
-rw-r--r--timeoutread.c4
-rw-r--r--timeoutread.h2
-rw-r--r--timeoutwrite.c2
-rw-r--r--trigger.c1
-rw-r--r--triggerpull.c1
94 files changed, 200 insertions, 124 deletions
diff --git a/.gitignore b/.gitignore
index 469dca4..978f39c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@ case_diffs.o
29case_lowerb.o 29case_lowerb.o
30case_lowers.o 30case_lowers.o
31case_starts.o 31case_starts.o
32case_startb.o
32case.a 33case.a
33getln.o 34getln.o
34getln2.o 35getln2.o
diff --git a/auto-gid.c b/auto-gid.c
index 774a8c1..2727cfc 100644
--- a/auto-gid.c
+++ b/auto-gid.c
@@ -1,8 +1,8 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include <grp.h> 3#include <grp.h>
3#include "subfd.h" 4#include "subfd.h"
4#include "substdio.h" 5#include "substdio.h"
5#include "readwrite.h"
6#include "exit.h" 6#include "exit.h"
7#include "scan.h" 7#include "scan.h"
8#include "fmt.h" 8#include "fmt.h"
diff --git a/auto-int.c b/auto-int.c
index c138869..8af2b6c 100644
--- a/auto-int.c
+++ b/auto-int.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "substdio.h" 2#include "substdio.h"
2#include "readwrite.h"
3#include "exit.h" 3#include "exit.h"
4#include "scan.h" 4#include "scan.h"
5#include "fmt.h" 5#include "fmt.h"
diff --git a/auto-int8.c b/auto-int8.c
index 091978f..2ff5dc7 100644
--- a/auto-int8.c
+++ b/auto-int8.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "substdio.h" 2#include "substdio.h"
2#include "readwrite.h"
3#include "exit.h" 3#include "exit.h"
4#include "scan.h" 4#include "scan.h"
5#include "fmt.h" 5#include "fmt.h"
diff --git a/auto-str.c b/auto-str.c
index acc3d60..ae38f33 100644
--- a/auto-str.c
+++ b/auto-str.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "substdio.h" 2#include "substdio.h"
2#include "readwrite.h"
3#include "exit.h" 3#include "exit.h"
4 4
5char buf1[256]; 5char buf1[256];
diff --git a/auto-uid.c b/auto-uid.c
index 326051c..6298a4f 100644
--- a/auto-uid.c
+++ b/auto-uid.c
@@ -1,8 +1,8 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include <pwd.h> 3#include <pwd.h>
3#include "subfd.h" 4#include "subfd.h"
4#include "substdio.h" 5#include "substdio.h"
5#include "readwrite.h"
6#include "exit.h" 6#include "exit.h"
7#include "scan.h" 7#include "scan.h"
8#include "fmt.h" 8#include "fmt.h"
diff --git a/bouncesaying.c b/bouncesaying.c
index c7d0026..cae5451 100644
--- a/bouncesaying.c
+++ b/bouncesaying.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "fork.h" 2#include "fork.h"
2#include "strerr.h" 3#include "strerr.h"
3#include "error.h" 4#include "error.h"
diff --git a/cdb_seek.c b/cdb_seek.c
index f31b87d..33e9f05 100644
--- a/cdb_seek.c
+++ b/cdb_seek.c
@@ -1,4 +1,5 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include <errno.h> 3#include <errno.h>
3#include "cdb.h" 4#include "cdb.h"
4 5
diff --git a/cdbmss.c b/cdbmss.c
index 2d8f367..b39b5c7 100644
--- a/cdbmss.c
+++ b/cdbmss.c
@@ -1,4 +1,5 @@
1#include "readwrite.h" 1#include <unistd.h>
2#include <stdio.h>
2#include "seek.h" 3#include "seek.h"
3#include "alloc.h" 4#include "alloc.h"
4#include "cdbmss.h" 5#include "cdbmss.h"
diff --git a/cdbmss.h b/cdbmss.h
index 5e6bdf4..6b7e30f 100644
--- a/cdbmss.h
+++ b/cdbmss.h
@@ -13,4 +13,8 @@ struct cdbmss {
13 int fd; 13 int fd;
14} ; 14} ;
15 15
16int cdbmss_start(struct cdbmss *c, int fd);
17int cdbmss_add(struct cdbmss *c, unsigned char *key, unsigned int keylen,
18 unsigned char *data, unsigned int datalen);
19int cdbmss_finish(struct cdbmss *c);
16#endif 20#endif
diff --git a/chkshsgr.c b/chkshsgr.c
index 2bcdade..bee9700 100644
--- a/chkshsgr.c
+++ b/chkshsgr.c
@@ -1,7 +1,11 @@
1#include <sys/types.h>
2#include <unistd.h>
3#include <grp.h>
1#include "exit.h" 4#include "exit.h"
5
2void main() 6void main()
3{ 7{
4 short x[4]; 8 gid_t x[4];
5 9
6 x[0] = x[1] = 0; 10 x[0] = x[1] = 0;
7 if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1); 11 if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
diff --git a/condredirect.c b/condredirect.c
index 593d2f5..4b65c96 100644
--- a/condredirect.c
+++ b/condredirect.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "sig.h" 2#include "sig.h"
2#include "readwrite.h"
3#include "exit.h" 3#include "exit.h"
4#include "env.h" 4#include "env.h"
5#include "error.h" 5#include "error.h"
@@ -15,7 +15,7 @@
15 15
16struct qmail qqt; 16struct qmail qqt;
17 17
18int mywrite(fd,buf,len) int fd; char *buf; int len; 18ssize_t mywrite(fd,buf,len) int fd; char *buf; int len;
19{ 19{
20 qmail_put(&qqt,buf,len); 20 qmail_put(&qqt,buf,len);
21 return len; 21 return len;
diff --git a/control.c b/control.c
index b655352..f3e4900 100644
--- a/control.c
+++ b/control.c
@@ -1,4 +1,4 @@
1#include "readwrite.h" 1#include <unistd.h>
2#include "open.h" 2#include "open.h"
3#include "getln.h" 3#include "getln.h"
4#include "stralloc.h" 4#include "stralloc.h"
diff --git a/dnscname.c b/dnscname.c
index b3cd6f1..37a95c5 100644
--- a/dnscname.c
+++ b/dnscname.c
@@ -1,9 +1,9 @@
1#include <unistd.h>
1#include "substdio.h" 2#include "substdio.h"
2#include "subfd.h" 3#include "subfd.h"
3#include "stralloc.h" 4#include "stralloc.h"
4#include "dns.h" 5#include "dns.h"
5#include "dnsdoe.h" 6#include "dnsdoe.h"
6#include "readwrite.h"
7#include "exit.h" 7#include "exit.h"
8 8
9stralloc sa = {0}; 9stralloc sa = {0};
diff --git a/dnsmxip.c b/dnsmxip.c
index 6d8e137..de40aa5 100644
--- a/dnsmxip.c
+++ b/dnsmxip.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "substdio.h" 2#include "substdio.h"
2#include "subfd.h" 3#include "subfd.h"
3#include "stralloc.h" 4#include "stralloc.h"
diff --git a/except.c b/except.c
index c553b3b..4d14da6 100644
--- a/except.c
+++ b/except.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "fork.h" 2#include "fork.h"
2#include "strerr.h" 3#include "strerr.h"
3#include "wait.h" 4#include "wait.h"
diff --git a/fd_copy.c b/fd_copy.c
index b9f7167..65d2345 100644
--- a/fd_copy.c
+++ b/fd_copy.c
@@ -1,4 +1,5 @@
1#include <fcntl.h> 1#include <fcntl.h>
2#include <unistd.h>
2#include "fd.h" 3#include "fd.h"
3 4
4int fd_copy(to,from) 5int fd_copy(to,from)
diff --git a/fd_move.c b/fd_move.c
index 1aa557f..09c474b 100644
--- a/fd_move.c
+++ b/fd_move.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "fd.h" 2#include "fd.h"
2 3
3int fd_move(to,from) 4int fd_move(to,from)
diff --git a/forward.c b/forward.c
index e7390aa..6cf0252 100644
--- a/forward.c
+++ b/forward.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "sig.h" 2#include "sig.h"
2#include "readwrite.h"
3#include "exit.h" 3#include "exit.h"
4#include "env.h" 4#include "env.h"
5#include "qmail.h" 5#include "qmail.h"
@@ -13,7 +13,7 @@ void die_nomem() { strerr_die2x(111,FATAL,"out of memory"); }
13 13
14struct qmail qqt; 14struct qmail qqt;
15 15
16int mywrite(fd,buf,len) int fd; char *buf; int len; 16ssize_t mywrite(fd,buf,len) int fd; char *buf; int len;
17{ 17{
18 qmail_put(&qqt,buf,len); 18 qmail_put(&qqt,buf,len);
19 return len; 19 return len;
diff --git a/hostname.c b/hostname.c
index 39c7f87..3dbae21 100644
--- a/hostname.c
+++ b/hostname.c
@@ -1,6 +1,6 @@
1#include <unistd.h>
1#include "substdio.h" 2#include "substdio.h"
2#include "subfd.h" 3#include "subfd.h"
3#include "readwrite.h"
4#include "exit.h" 4#include "exit.h"
5 5
6char host[256]; 6char host[256];
diff --git a/idedit.c b/idedit.c
index e6747b5..5c209e2 100644
--- a/idedit.c
+++ b/idedit.c
@@ -1,7 +1,7 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include <pwd.h> 3#include <pwd.h>
3#include <grp.h> 4#include <grp.h>
4#include "readwrite.h"
5#include "exit.h" 5#include "exit.h"
6#include "scan.h" 6#include "scan.h"
7#include "fmt.h" 7#include "fmt.h"
@@ -9,6 +9,7 @@
9#include "open.h" 9#include "open.h"
10#include "seek.h" 10#include "seek.h"
11#include "fork.h" 11#include "fork.h"
12#include "wait.h"
12 13
13#define FATAL "idedit: fatal: " 14#define FATAL "idedit: fatal: "
14#define WARNING "idedit: warning: " 15#define WARNING "idedit: warning: "
diff --git a/install.c b/install.c
index 95034f2..244072f 100644
--- a/install.c
+++ b/install.c
@@ -1,9 +1,11 @@
1#include <sys/stat.h>
2#include <unistd.h>
1#include "substdio.h" 3#include "substdio.h"
2#include "strerr.h" 4#include "strerr.h"
3#include "error.h" 5#include "error.h"
4#include "open.h" 6#include "open.h"
5#include "readwrite.h"
6#include "exit.h" 7#include "exit.h"
8#include "fifo.h"
7 9
8extern void hier(); 10extern void hier();
9 11
diff --git a/instcheck.c b/instcheck.c
index d41efda..ed4900f 100644
--- a/instcheck.c
+++ b/instcheck.c
@@ -1,8 +1,8 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include "strerr.h" 4#include "strerr.h"
4#include "error.h" 5#include "error.h"
5#include "readwrite.h"
6#include "exit.h" 6#include "exit.h"
7 7
8extern void hier(); 8extern void hier();
diff --git a/ipme.c b/ipme.c
index f636ab5..40bf926 100644
--- a/ipme.c
+++ b/ipme.c
@@ -8,6 +8,7 @@
8#ifndef SIOCGIFCONF /* whatever works */ 8#ifndef SIOCGIFCONF /* whatever works */
9#include <sys/sockio.h> 9#include <sys/sockio.h>
10#endif 10#endif
11#include <unistd.h>
11#include "hassalen.h" 12#include "hassalen.h"
12#include "byte.h" 13#include "byte.h"
13#include "ip.h" 14#include "ip.h"
diff --git a/maildir.c b/maildir.c
index efbd3d4..5ef3a5a 100644
--- a/maildir.c
+++ b/maildir.c
@@ -1,5 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include "prioq.h" 4#include "prioq.h"
4#include "env.h" 5#include "env.h"
5#include "stralloc.h" 6#include "stralloc.h"
diff --git a/maildir2mbox.c b/maildir2mbox.c
index 7364441..39361f2 100644
--- a/maildir2mbox.c
+++ b/maildir2mbox.c
@@ -1,4 +1,7 @@
1#include "readwrite.h" 1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
4#include <stdio.h>
2#include "prioq.h" 5#include "prioq.h"
3#include "env.h" 6#include "env.h"
4#include "stralloc.h" 7#include "stralloc.h"
diff --git a/maildirgetquota.c b/maildirgetquota.c
index 1c541f8..a863f47 100644
--- a/maildirgetquota.c
+++ b/maildirgetquota.c
@@ -5,9 +5,7 @@
5 5
6#include "maildirgetquota.h" 6#include "maildirgetquota.h"
7#include "maildirmisc.h" 7#include "maildirmisc.h"
8#if HAVE_UNISTD_H
9#include <unistd.h> 8#include <unistd.h>
10#endif
11#include <stdlib.h> 9#include <stdlib.h>
12#include <string.h> 10#include <string.h>
13#include <fcntl.h> 11#include <fcntl.h>
diff --git a/maildirmake.c b/maildirmake.c
index 9863fef..0be327e 100644
--- a/maildirmake.c
+++ b/maildirmake.c
@@ -1,3 +1,6 @@
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
1#include "strerr.h" 4#include "strerr.h"
2#include "exit.h" 5#include "exit.h"
3 6
diff --git a/maildirmisc.h b/maildirmisc.h
index 86743bc..dc96b55 100644
--- a/maildirmisc.h
+++ b/maildirmisc.h
@@ -136,6 +136,8 @@ char *maildir_getlink(const char *);
136 136
137int maildir_hasflag(const char *filename, char); 137int maildir_hasflag(const char *filename, char);
138 138
139int user_over_maildirquota(const char *, const char *);
140
139#define MAILDIR_DELETED(f) maildir_hasflag((f), 'T') 141#define MAILDIR_DELETED(f) maildir_hasflag((f), 'T')
140 142
141#ifdef __cplusplus 143#ifdef __cplusplus
diff --git a/maildiropen.c b/maildiropen.c
index bcaadd4..85e706b 100644
--- a/maildiropen.c
+++ b/maildiropen.c
@@ -12,9 +12,7 @@
12#include <string.h> 12#include <string.h>
13#include <stdlib.h> 13#include <stdlib.h>
14#include <time.h> 14#include <time.h>
15#if HAVE_UNISTD_H
16#include <unistd.h> 15#include <unistd.h>
17#endif
18#include <stdio.h> 16#include <stdio.h>
19#include <ctype.h> 17#include <ctype.h>
20#include <errno.h> 18#include <errno.h>
diff --git a/maildirquota.c b/maildirquota.c
index e9ba47b..d5609c2 100644
--- a/maildirquota.c
+++ b/maildirquota.c
@@ -25,9 +25,7 @@
25#endif 25#endif
26#endif */ 26#endif */
27#include <sys/types.h> 27#include <sys/types.h>
28/* #if HAVE_SYS_STAT_H */
29#include <sys/stat.h> 28#include <sys/stat.h>
30/* #endif */
31#include <sys/uio.h> 29#include <sys/uio.h>
32 30
33#include "maildirquota.h" 31#include "maildirquota.h"
@@ -36,12 +34,8 @@
36#include <stdlib.h> 34#include <stdlib.h>
37#include <string.h> 35#include <string.h>
38#include <errno.h> 36#include <errno.h>
39/* #if HAVE_FCNTL_H */
40#include <fcntl.h> 37#include <fcntl.h>
41/* #endif */
42#if HAVE_UNISTD_H
43#include <unistd.h> 38#include <unistd.h>
44#endif
45#include <time.h> 39#include <time.h>
46#include "numlib.h" 40#include "numlib.h"
47 41
diff --git a/maildirwatch.c b/maildirwatch.c
index 40d8322..8a26f6e 100644
--- a/maildirwatch.c
+++ b/maildirwatch.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "getln.h" 2#include "getln.h"
2#include "substdio.h" 3#include "substdio.h"
3#include "subfd.h" 4#include "subfd.h"
@@ -6,7 +7,6 @@
6#include "str.h" 7#include "str.h"
7#include "exit.h" 8#include "exit.h"
8#include "hfield.h" 9#include "hfield.h"
9#include "readwrite.h"
10#include "open.h" 10#include "open.h"
11#include "headerbody.h" 11#include "headerbody.h"
12#include "maildir.h" 12#include "maildir.h"
diff --git a/newfield.c b/newfield.c
index 78d6bb8..e2cd5d4 100644
--- a/newfield.c
+++ b/newfield.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "fmt.h" 2#include "fmt.h"
2#include "datetime.h" 3#include "datetime.h"
3#include "stralloc.h" 4#include "stralloc.h"
diff --git a/overmaildirquota.c b/overmaildirquota.c
index 5e1877c..553d3ec 100644
--- a/overmaildirquota.c
+++ b/overmaildirquota.c
@@ -6,11 +6,12 @@
6#if HAVE_CONFIG_H 6#if HAVE_CONFIG_H
7#include "config.h" 7#include "config.h"
8#endif 8#endif
9#include "maildirquota.h" 9#include "maildirquota.h"
10#include <stdlib.h> 10#include <stdlib.h>
11#include <string.h> 11#include <string.h>
12#include <errno.h> 12#include <errno.h>
13#include <sys/stat.h> 13#include <unistd.h>
14#include <sys/stat.h>
14 15
15static const char rcsid[]="$Id: overquota.c,v 1.0 2002/06/09 16:21:05 mr \ 16static const char rcsid[]="$Id: overquota.c,v 1.0 2002/06/09 16:21:05 mr \
16sam Exp $"; 17sam Exp $";
diff --git a/predate.c b/predate.c
index 9648f6e..46b81f3 100644
--- a/predate.c
+++ b/predate.c
@@ -1,4 +1,5 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include <time.h> 3#include <time.h>
3#include "datetime.h" 4#include "datetime.h"
4#include "fork.h" 5#include "fork.h"
@@ -8,8 +9,8 @@
8#include "strerr.h" 9#include "strerr.h"
9#include "substdio.h" 10#include "substdio.h"
10#include "subfd.h" 11#include "subfd.h"
11#include "readwrite.h"
12#include "exit.h" 12#include "exit.h"
13#include "sig.h"
13 14
14#define FATAL "predate: fatal: " 15#define FATAL "predate: fatal: "
15 16
diff --git a/preline.c b/preline.c
index 1a4cef8..8ca1c38 100644
--- a/preline.c
+++ b/preline.c
@@ -1,6 +1,6 @@
1#include <unistd.h>
1#include "fd.h" 2#include "fd.h"
2#include "sgetopt.h" 3#include "sgetopt.h"
3#include "readwrite.h"
4#include "strerr.h" 4#include "strerr.h"
5#include "substdio.h" 5#include "substdio.h"
6#include "exit.h" 6#include "exit.h"
diff --git a/prot.c b/prot.c
index a38e0f9..448fe95 100644
--- a/prot.c
+++ b/prot.c
@@ -1,3 +1,6 @@
1#include <sys/types.h>
2#include <unistd.h>
3#include <grp.h>
1#include "hasshsgr.h" 4#include "hasshsgr.h"
2#include "prot.h" 5#include "prot.h"
3 6
diff --git a/qbiff.c b/qbiff.c
index 4e9f1d8..a068ad9 100644
--- a/qbiff.c
+++ b/qbiff.c
@@ -1,5 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include <utmp.h> 4#include <utmp.h>
4#ifndef UTMP_FILE 5#ifndef UTMP_FILE
5#ifdef _PATH_UTMP 6#ifdef _PATH_UTMP
@@ -8,7 +9,6 @@
8#define UTMP_FILE "/etc/utmp" 9#define UTMP_FILE "/etc/utmp"
9#endif 10#endif
10#endif 11#endif
11#include "readwrite.h"
12#include "stralloc.h" 12#include "stralloc.h"
13#include "substdio.h" 13#include "substdio.h"
14#include "subfd.h" 14#include "subfd.h"
diff --git a/qmail-clean.c b/qmail-clean.c
index 4926f86..cba8818 100644
--- a/qmail-clean.c
+++ b/qmail-clean.c
@@ -1,6 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include "readwrite.h" 3#include <unistd.h>
4#include "sig.h" 4#include "sig.h"
5#include "now.h" 5#include "now.h"
6#include "str.h" 6#include "str.h"
diff --git a/qmail-getpw.c b/qmail-getpw.c
index 128c682..bd3419d 100644
--- a/qmail-getpw.c
+++ b/qmail-getpw.c
@@ -1,7 +1,7 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include <pwd.h> 4#include <pwd.h>
4#include "readwrite.h"
5#include "substdio.h" 5#include "substdio.h"
6#include "subfd.h" 6#include "subfd.h"
7#include "error.h" 7#include "error.h"
diff --git a/qmail-inject.c b/qmail-inject.c
index ac7ac32..43b53fe 100644
--- a/qmail-inject.c
+++ b/qmail-inject.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "sig.h" 2#include "sig.h"
2#include "substdio.h" 3#include "substdio.h"
3#include "stralloc.h" 4#include "stralloc.h"
diff --git a/qmail-local.c b/qmail-local.c
index 1bafb34..0376408 100644
--- a/qmail-local.c
+++ b/qmail-local.c
@@ -1,6 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include "readwrite.h" 3#include <unistd.h>
4#include "sig.h" 4#include "sig.h"
5#include "env.h" 5#include "env.h"
6#include "byte.h" 6#include "byte.h"
@@ -28,6 +28,8 @@
28#include "myctime.h" 28#include "myctime.h"
29#include "gfrom.h" 29#include "gfrom.h"
30#include "auto_patrn.h" 30#include "auto_patrn.h"
31#include "maildirgetquota.h"
32#include "maildirmisc.h"
31 33
32void usage() { strerr_die1x(100,"qmail-local: usage: qmail-local [ -nN ] user homedir local dash ext domain sender aliasempty"); } 34void usage() { strerr_die1x(100,"qmail-local: usage: qmail-local [ -nN ] user homedir local dash ext domain sender aliasempty"); }
33 35
diff --git a/qmail-lspawn.c b/qmail-lspawn.c
index 5109cc3..ab8b65d 100644
--- a/qmail-lspawn.c
+++ b/qmail-lspawn.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "fd.h" 2#include "fd.h"
2#include "wait.h" 3#include "wait.h"
3#include "prot.h" 4#include "prot.h"
@@ -13,6 +14,8 @@
13#include "auto_qmail.h" 14#include "auto_qmail.h"
14#include "auto_uids.h" 15#include "auto_uids.h"
15#include "qlx.h" 16#include "qlx.h"
17#include "open.h"
18#include "byte.h"
16 19
17char *aliasempty; 20char *aliasempty;
18 21
diff --git a/qmail-newbrt.c b/qmail-newbrt.c
index 9344444..93e05af 100644
--- a/qmail-newbrt.c
+++ b/qmail-newbrt.c
@@ -1,12 +1,16 @@
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
4#include <stdio.h>
1#include "strerr.h" 5#include "strerr.h"
2#include "stralloc.h" 6#include "stralloc.h"
3#include "substdio.h" 7#include "substdio.h"
4#include "getln.h" 8#include "getln.h"
5#include "exit.h" 9#include "exit.h"
6#include "readwrite.h"
7#include "open.h" 10#include "open.h"
8#include "auto_qmail.h" 11#include "auto_qmail.h"
9#include "cdbmss.h" 12#include "cdbmss.h"
13#include "case.h"
10 14
11#define FATAL "qmail-newbrt: fatal: " 15#define FATAL "qmail-newbrt: fatal: "
12 16
diff --git a/qmail-newmrh.c b/qmail-newmrh.c
index 25a4a10..d9ff992 100644
--- a/qmail-newmrh.c
+++ b/qmail-newmrh.c
@@ -1,12 +1,16 @@
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
4#include <stdio.h>
1#include "strerr.h" 5#include "strerr.h"
2#include "stralloc.h" 6#include "stralloc.h"
3#include "substdio.h" 7#include "substdio.h"
4#include "getln.h" 8#include "getln.h"
5#include "exit.h" 9#include "exit.h"
6#include "readwrite.h"
7#include "open.h" 10#include "open.h"
8#include "auto_qmail.h" 11#include "auto_qmail.h"
9#include "cdbmss.h" 12#include "cdbmss.h"
13#include "case.h"
10 14
11#define FATAL "qmail-newmrh: fatal: " 15#define FATAL "qmail-newmrh: fatal: "
12 16
diff --git a/qmail-newu.c b/qmail-newu.c
index 1f9ecc3..3d19c6f 100644
--- a/qmail-newu.c
+++ b/qmail-newu.c
@@ -1,14 +1,18 @@
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
4#include <stdio.h>
1#include "stralloc.h" 5#include "stralloc.h"
2#include "subfd.h" 6#include "subfd.h"
3#include "getln.h" 7#include "getln.h"
4#include "substdio.h" 8#include "substdio.h"
5#include "cdbmss.h" 9#include "cdbmss.h"
6#include "exit.h" 10#include "exit.h"
7#include "readwrite.h"
8#include "open.h" 11#include "open.h"
9#include "error.h" 12#include "error.h"
10#include "case.h" 13#include "case.h"
11#include "auto_qmail.h" 14#include "auto_qmail.h"
15#include "byte.h"
12 16
13void die_temp() { _exit(111); } 17void die_temp() { _exit(111); }
14 18
diff --git a/qmail-pop3d.c b/qmail-pop3d.c
index e299339..e547b24 100644
--- a/qmail-pop3d.c
+++ b/qmail-pop3d.c
@@ -1,5 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include "commands.h" 4#include "commands.h"
4#include "sig.h" 5#include "sig.h"
5#include "getln.h" 6#include "getln.h"
@@ -13,28 +14,28 @@
13#include "str.h" 14#include "str.h"
14#include "exit.h" 15#include "exit.h"
15#include "maildir.h" 16#include "maildir.h"
16#include "readwrite.h"
17#include "timeoutread.h" 17#include "timeoutread.h"
18#include "timeoutwrite.h" 18#include "timeoutwrite.h"
19#include <errno.h> 19#include <errno.h>
20#include "maildirquota.h" 20#include "maildirquota.h"
21#include "maildirmisc.h" 21#include "maildirmisc.h"
22#include "maildirgetquota.h"
22 23
23#define QUOTABUFSIZE 256 24#define QUOTABUFSIZE 256
24 25
25void die() { _exit(0); } 26void die() { _exit(0); }
26 27
27int saferead(fd,buf,len) int fd; char *buf; int len; 28ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
28{ 29{
29 int r; 30 ssize_t r;
30 r = timeoutread(1200,fd,buf,len); 31 r = timeoutread(1200,fd,buf,len);
31 if (r <= 0) die(); 32 if (r <= 0) die();
32 return r; 33 return r;
33} 34}
34 35
35int safewrite(fd,buf,len) int fd; char *buf; int len; 36ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
36{ 37{
37 int r; 38 ssize_t r;
38 r = timeoutwrite(1200,fd,buf,len); 39 r = timeoutwrite(1200,fd,buf,len);
39 if (r <= 0) die(); 40 if (r <= 0) die();
40 return r; 41 return r;
diff --git a/qmail-popup.c b/qmail-popup.c
index 8e5bc76..10cc55a 100644
--- a/qmail-popup.c
+++ b/qmail-popup.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "commands.h" 2#include "commands.h"
2#include "fd.h" 3#include "fd.h"
3#include "sig.h" 4#include "sig.h"
@@ -10,23 +11,22 @@
10#include "now.h" 11#include "now.h"
11#include "fmt.h" 12#include "fmt.h"
12#include "exit.h" 13#include "exit.h"
13#include "readwrite.h"
14#include "timeoutread.h" 14#include "timeoutread.h"
15#include "timeoutwrite.h" 15#include "timeoutwrite.h"
16 16
17void die() { _exit(1); } 17void die() { _exit(1); }
18 18
19int saferead(fd,buf,len) int fd; char *buf; int len; 19ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
20{ 20{
21 int r; 21 ssize_t r;
22 r = timeoutread(1200,fd,buf,len); 22 r = timeoutread(1200,fd,buf,len);
23 if (r <= 0) die(); 23 if (r <= 0) die();
24 return r; 24 return r;
25} 25}
26 26
27int safewrite(fd,buf,len) int fd; char *buf; int len; 27ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
28{ 28{
29 int r; 29 ssize_t r;
30 r = timeoutwrite(1200,fd,buf,len); 30 r = timeoutwrite(1200,fd,buf,len);
31 if (r <= 0) die(); 31 if (r <= 0) die();
32 return r; 32 return r;
diff --git a/qmail-pw2u.c b/qmail-pw2u.c
index f068ab1..0257f39 100644
--- a/qmail-pw2u.c
+++ b/qmail-pw2u.c
@@ -1,7 +1,7 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include "substdio.h" 4#include "substdio.h"
4#include "readwrite.h"
5#include "subfd.h" 5#include "subfd.h"
6#include "sgetopt.h" 6#include "sgetopt.h"
7#include "control.h" 7#include "control.h"
@@ -17,6 +17,7 @@
17#include "auto_qmail.h" 17#include "auto_qmail.h"
18#include "auto_usera.h" 18#include "auto_usera.h"
19#include "exit.h" 19#include "exit.h"
20#include "byte.h"
20 21
21void die_chdir() 22void die_chdir()
22{ 23{
diff --git a/qmail-qmqpc.c b/qmail-qmqpc.c
index d5adf05..ef63ec8 100644
--- a/qmail-qmqpc.c
+++ b/qmail-qmqpc.c
@@ -2,9 +2,9 @@
2#include <sys/socket.h> 2#include <sys/socket.h>
3#include <netinet/in.h> 3#include <netinet/in.h>
4#include <arpa/inet.h> 4#include <arpa/inet.h>
5#include <unistd.h>
5#include "substdio.h" 6#include "substdio.h"
6#include "getln.h" 7#include "getln.h"
7#include "readwrite.h"
8#include "exit.h" 8#include "exit.h"
9#include "stralloc.h" 9#include "stralloc.h"
10#include "slurpclose.h" 10#include "slurpclose.h"
@@ -34,16 +34,16 @@ void die_format() { _exit(91); }
34int lasterror = 55; 34int lasterror = 55;
35int qmqpfd; 35int qmqpfd;
36 36
37int saferead(fd,buf,len) int fd; char *buf; int len; 37ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
38{ 38{
39 int r; 39 ssize_t r;
40 r = timeoutread(60,qmqpfd,buf,len); 40 r = timeoutread(60,qmqpfd,buf,len);
41 if (r <= 0) die_conn(); 41 if (r <= 0) die_conn();
42 return r; 42 return r;
43} 43}
44int safewrite(fd,buf,len) int fd; char *buf; int len; 44ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
45{ 45{
46 int r; 46 ssize_t r;
47 r = timeoutwrite(60,qmqpfd,buf,len); 47 r = timeoutwrite(60,qmqpfd,buf,len);
48 if (r <= 0) die_conn(); 48 if (r <= 0) die_conn();
49 return r; 49 return r;
@@ -135,7 +135,7 @@ char *server;
135 135
136stralloc servers = {0}; 136stralloc servers = {0};
137 137
138main() 138int main()
139{ 139{
140 int i; 140 int i;
141 int j; 141 int j;
@@ -156,4 +156,5 @@ main()
156 } 156 }
157 157
158 _exit(lasterror); 158 _exit(lasterror);
159 return 0;
159} 160}
diff --git a/qmail-qmqpd.c b/qmail-qmqpd.c
index 86cb284..8726ab0 100644
--- a/qmail-qmqpd.c
+++ b/qmail-qmqpd.c
@@ -1,26 +1,28 @@
1#include <unistd.h>
1#include "auto_qmail.h" 2#include "auto_qmail.h"
2#include "qmail.h" 3#include "qmail.h"
3#include "received.h" 4#include "received.h"
4#include "sig.h" 5#include "sig.h"
5#include "substdio.h" 6#include "substdio.h"
6#include "readwrite.h"
7#include "exit.h" 7#include "exit.h"
8#include "now.h" 8#include "now.h"
9#include "fmt.h" 9#include "fmt.h"
10#include "env.h" 10#include "env.h"
11#include "byte.h"
12#include "str.h"
11 13
12void resources() { _exit(111); } 14void resources() { _exit(111); }
13 15
14int safewrite(fd,buf,len) int fd; char *buf; int len; 16ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
15{ 17{
16 int r; 18 ssize_t r;
17 r = write(fd,buf,len); 19 r = write(fd,buf,len);
18 if (r <= 0) _exit(0); 20 if (r <= 0) _exit(0);
19 return r; 21 return r;
20} 22}
21int saferead(fd,buf,len) int fd; char *buf; int len; 23ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
22{ 24{
23 int r; 25 ssize_t r;
24 r = read(fd,buf,len); 26 r = read(fd,buf,len);
25 if (r <= 0) _exit(0); 27 if (r <= 0) _exit(0);
26 return r; 28 return r;
@@ -105,7 +107,7 @@ int getbuf()
105 107
106int flagok = 1; 108int flagok = 1;
107 109
108main() 110int main()
109{ 111{
110 char *result; 112 char *result;
111 unsigned long qp; 113 unsigned long qp;
@@ -171,4 +173,5 @@ main()
171 substdio_puts(&ssout,","); 173 substdio_puts(&ssout,",");
172 substdio_flush(&ssout); 174 substdio_flush(&ssout);
173 _exit(0); 175 _exit(0);
176 return 0;
174} 177}
diff --git a/qmail-qmtpd.c b/qmail-qmtpd.c
index 85a0f99..1055274 100644
--- a/qmail-qmtpd.c
+++ b/qmail-qmtpd.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "stralloc.h" 2#include "stralloc.h"
2#include "substdio.h" 3#include "substdio.h"
3#include "qmail.h" 4#include "qmail.h"
@@ -8,10 +9,10 @@
8#include "sig.h" 9#include "sig.h"
9#include "rcpthosts.h" 10#include "rcpthosts.h"
10#include "auto_qmail.h" 11#include "auto_qmail.h"
11#include "readwrite.h"
12#include "control.h" 12#include "control.h"
13#include "received.h" 13#include "received.h"
14#include "exit.h" 14#include "exit.h"
15#include "scan.h"
15 16
16void badproto() { _exit(100); } 17void badproto() { _exit(100); }
17void resources() { _exit(111); } 18void resources() { _exit(111); }
@@ -25,9 +26,9 @@ extern void realrcptto_start();
25extern int realrcptto(); 26extern int realrcptto();
26extern int realrcptto_deny(); 27extern int realrcptto_deny();
27 28
28int safewrite(fd,buf,len) int fd; char *buf; int len; 29ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
29{ 30{
30 int r; 31 ssize_t r;
31 r = write(fd,buf,len); 32 r = write(fd,buf,len);
32 if (r <= 0) _exit(0); 33 if (r <= 0) _exit(0);
33 return r; 34 return r;
@@ -36,9 +37,9 @@ int safewrite(fd,buf,len) int fd; char *buf; int len;
36char ssoutbuf[256]; 37char ssoutbuf[256];
37substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf); 38substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf);
38 39
39int saferead(fd,buf,len) int fd; char *buf; int len; 40ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
40{ 41{
41 int r; 42 ssize_t r;
42 substdio_flush(&ssout); 43 substdio_flush(&ssout);
43 r = read(fd,buf,len); 44 r = read(fd,buf,len);
44 if (r <= 0) _exit(0); 45 if (r <= 0) _exit(0);
@@ -84,7 +85,7 @@ stralloc failure = {0};
84char *relayclient; 85char *relayclient;
85int relayclientlen; 86int relayclientlen;
86 87
87main() 88int main()
88{ 89{
89 char ch; 90 char ch;
90 int i; 91 int i;
@@ -283,4 +284,5 @@ main()
283 284
284 /* ssout will be flushed when we read from the network again */ 285 /* ssout will be flushed when we read from the network again */
285 } 286 }
287 return 0;
286} 288}
diff --git a/qmail-qread.c b/qmail-qread.c
index 8ec0fbd..4bdc92f 100644
--- a/qmail-qread.c
+++ b/qmail-qread.c
@@ -1,5 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include "stralloc.h" 4#include "stralloc.h"
4#include "substdio.h" 5#include "substdio.h"
5#include "subfd.h" 6#include "subfd.h"
@@ -12,7 +13,6 @@
12#include "open.h" 13#include "open.h"
13#include "datetime.h" 14#include "datetime.h"
14#include "date822fmt.h" 15#include "date822fmt.h"
15#include "readwrite.h"
16#include "error.h" 16#include "error.h"
17#include "exit.h" 17#include "exit.h"
18 18
diff --git a/qmail-queue.c b/qmail-queue.c
index 7d5ed67..e7272b0 100644
--- a/qmail-queue.c
+++ b/qmail-queue.c
@@ -1,6 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include "readwrite.h" 3#include <unistd.h>
4#include "sig.h" 4#include "sig.h"
5#include "exit.h" 5#include "exit.h"
6#include "open.h" 6#include "open.h"
diff --git a/qmail-remote.c b/qmail-remote.c
index 58437da..0e2377e 100644
--- a/qmail-remote.c
+++ b/qmail-remote.c
@@ -3,6 +3,7 @@
3#include <sys/socket.h> 3#include <sys/socket.h>
4#include <netinet/in.h> 4#include <netinet/in.h>
5#include <arpa/inet.h> 5#include <arpa/inet.h>
6#include <unistd.h>
6#include "sig.h" 7#include "sig.h"
7#include "stralloc.h" 8#include "stralloc.h"
8#include "substdio.h" 9#include "substdio.h"
@@ -26,7 +27,6 @@
26#include "exit.h" 27#include "exit.h"
27#include "constmap.h" 28#include "constmap.h"
28#include "tcpto.h" 29#include "tcpto.h"
29#include "readwrite.h"
30#include "timeoutconn.h" 30#include "timeoutconn.h"
31#include "timeoutread.h" 31#include "timeoutread.h"
32#include "timeoutwrite.h" 32#include "timeoutwrite.h"
@@ -161,9 +161,9 @@ int timeoutconnect = 60;
161int smtpfd; 161int smtpfd;
162int timeout = 1200; 162int timeout = 1200;
163 163
164int saferead(fd,buf,len) int fd; char *buf; int len; 164ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
165{ 165{
166 int r; 166 ssize_t r;
167#ifdef TLS 167#ifdef TLS
168 if (ssl) { 168 if (ssl) {
169 r = ssl_timeoutread(timeout, smtpfd, smtpfd, ssl, buf, len); 169 r = ssl_timeoutread(timeout, smtpfd, smtpfd, ssl, buf, len);
@@ -174,9 +174,9 @@ int saferead(fd,buf,len) int fd; char *buf; int len;
174 if (r <= 0) dropped(); 174 if (r <= 0) dropped();
175 return r; 175 return r;
176} 176}
177int safewrite(fd,buf,len) int fd; char *buf; int len; 177ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
178{ 178{
179 int r; 179 ssize_t r;
180#ifdef TLS 180#ifdef TLS
181 if (ssl) { 181 if (ssl) {
182 r = ssl_timeoutwrite(timeout, smtpfd, smtpfd, ssl, buf, len); 182 r = ssl_timeoutwrite(timeout, smtpfd, smtpfd, ssl, buf, len);
diff --git a/qmail-rspawn.c b/qmail-rspawn.c
index 0177c8b..e0a9d5e 100644
--- a/qmail-rspawn.c
+++ b/qmail-rspawn.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "fd.h" 2#include "fd.h"
2#include "wait.h" 3#include "wait.h"
3#include "substdio.h" 4#include "substdio.h"
diff --git a/qmail-send.c b/qmail-send.c
index 8c6237e..9d76228 100644
--- a/qmail-send.c
+++ b/qmail-send.c
@@ -1,6 +1,7 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include "readwrite.h" 3#include <unistd.h>
4#include <utime.h>
4#include "sig.h" 5#include "sig.h"
5#include "direntry.h" 6#include "direntry.h"
6#include "control.h" 7#include "control.h"
@@ -484,15 +485,15 @@ void pqfinish()
484{ 485{
485 int c; 486 int c;
486 struct prioq_elt pe; 487 struct prioq_elt pe;
487 time_t ut[2]; /* XXX: more portable than utimbuf, but still worrisome */ 488 struct utimbuf ut;
488 489
489 for (c = 0;c < CHANNELS;++c) 490 for (c = 0;c < CHANNELS;++c)
490 while (prioq_min(&pqchan[c],&pe)) 491 while (prioq_min(&pqchan[c],&pe))
491 { 492 {
492 prioq_delmin(&pqchan[c]); 493 prioq_delmin(&pqchan[c]);
493 fnmake_chanaddr(pe.id,c); 494 fnmake_chanaddr(pe.id,c);
494 ut[0] = ut[1] = pe.dt; 495 ut.actime = ut.modtime = pe.dt;
495 if (utime(fn.s,ut) == -1) 496 if (utime(fn.s,&ut) == -1)
496 log3("warning: unable to utime ",fn.s,"; message will be retried too soon\n"); 497 log3("warning: unable to utime ",fn.s,"; message will be retried too soon\n");
497 } 498 }
498} 499}
diff --git a/qmail-showctl.c b/qmail-showctl.c
index 9d4e1bc..50755c4 100644
--- a/qmail-showctl.c
+++ b/qmail-showctl.c
@@ -1,5 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include "substdio.h" 4#include "substdio.h"
4#include "subfd.h" 5#include "subfd.h"
5#include "exit.h" 6#include "exit.h"
diff --git a/qmail-smtpd.c b/qmail-smtpd.c
index 3352911..38c5929 100644
--- a/qmail-smtpd.c
+++ b/qmail-smtpd.c
@@ -1,6 +1,7 @@
1#include <arpa/inet.h> 1#include <arpa/inet.h>
2#include <sys/time.h>
3#include <unistd.h>
2#include "sig.h" 4#include "sig.h"
3#include "readwrite.h"
4#include "stralloc.h" 5#include "stralloc.h"
5#include "substdio.h" 6#include "substdio.h"
6#include "alloc.h" 7#include "alloc.h"
@@ -86,9 +87,9 @@ int smtputf8 = 0;
86int flagauth = 0; 87int flagauth = 0;
87char **childargs; 88char **childargs;
88 89
89int safewrite(fd,buf,len) int fd; char *buf; int len; 90ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
90{ 91{
91 int r; 92 ssize_t r;
92#ifdef TLS 93#ifdef TLS
93 if (ssl && fd == ssl_wfd) 94 if (ssl && fd == ssl_wfd)
94 r = ssl_timeoutwrite(timeout, ssl_rfd, ssl_wfd, ssl, buf, len); 95 r = ssl_timeoutwrite(timeout, ssl_rfd, ssl_wfd, ssl, buf, len);
@@ -796,9 +797,9 @@ void smtp_rcpt(arg) char *arg; {
796} 797}
797 798
798 799
799int saferead(fd,buf,len) int fd; char *buf; int len; 800ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
800{ 801{
801 int r; 802 ssize_t r;
802 flush(); 803 flush();
803#ifdef TLS 804#ifdef TLS
804 if (ssl && fd == ssl_rfd) 805 if (ssl && fd == ssl_rfd)
diff --git a/qmail-spp.c b/qmail-spp.c
index 78ab9e7..dbe14bf 100644
--- a/qmail-spp.c
+++ b/qmail-spp.c
@@ -29,7 +29,7 @@
29 * 29 *
30 */ 30 */
31 31
32#include "readwrite.h" 32#include <unistd.h>
33#include "stralloc.h" 33#include "stralloc.h"
34#include "substdio.h" 34#include "substdio.h"
35#include "control.h" 35#include "control.h"
diff --git a/qmail-start.c b/qmail-start.c
index 37423b0..866de0d 100644
--- a/qmail-start.c
+++ b/qmail-start.c
@@ -1,3 +1,6 @@
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
1#include "fd.h" 4#include "fd.h"
2#include "prot.h" 5#include "prot.h"
3#include "exit.h" 6#include "exit.h"
diff --git a/qmail-tcpok.c b/qmail-tcpok.c
index a9b9652..d99cca5 100644
--- a/qmail-tcpok.c
+++ b/qmail-tcpok.c
@@ -1,8 +1,8 @@
1#include <unistd.h>
1#include "strerr.h" 2#include "strerr.h"
2#include "substdio.h" 3#include "substdio.h"
3#include "lock.h" 4#include "lock.h"
4#include "open.h" 5#include "open.h"
5#include "readwrite.h"
6#include "auto_qmail.h" 6#include "auto_qmail.h"
7#include "exit.h" 7#include "exit.h"
8 8
diff --git a/qmail-tcpto.c b/qmail-tcpto.c
index d181ecf..ecf2ecc 100644
--- a/qmail-tcpto.c
+++ b/qmail-tcpto.c
@@ -1,5 +1,6 @@
1/* XXX: this program knows quite a bit about tcpto's internals */ 1/* XXX: this program knows quite a bit about tcpto's internals */
2 2
3#include <unistd.h>
3#include "substdio.h" 4#include "substdio.h"
4#include "subfd.h" 5#include "subfd.h"
5#include "auto_qmail.h" 6#include "auto_qmail.h"
@@ -10,6 +11,8 @@
10#include "exit.h" 11#include "exit.h"
11#include "datetime.h" 12#include "datetime.h"
12#include "now.h" 13#include "now.h"
14#include "open.h"
15#include "byte.h"
13 16
14void die(n) int n; { substdio_flush(subfdout); _exit(n); } 17void die(n) int n; { substdio_flush(subfdout); _exit(n); }
15 18
diff --git a/qmail.c b/qmail.c
index e61260f..5b7c449 100644
--- a/qmail.c
+++ b/qmail.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "substdio.h" 2#include "substdio.h"
2#include "readwrite.h"
3#include "wait.h" 3#include "wait.h"
4#include "exit.h" 4#include "exit.h"
5#include "fork.h" 5#include "fork.h"
diff --git a/qsmhook.c b/qsmhook.c
index d5b38aa..a024683 100644
--- a/qsmhook.c
+++ b/qsmhook.c
@@ -1,6 +1,6 @@
1#include <unistd.h>
1#include "fd.h" 2#include "fd.h"
2#include "stralloc.h" 3#include "stralloc.h"
3#include "readwrite.h"
4#include "sgetopt.h" 4#include "sgetopt.h"
5#include "wait.h" 5#include "wait.h"
6#include "env.h" 6#include "env.h"
diff --git a/qsutil.c b/qsutil.c
index 43890d0..0e07953 100644
--- a/qsutil.c
+++ b/qsutil.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "stralloc.h" 2#include "stralloc.h"
2#include "readwrite.h"
3#include "substdio.h" 3#include "substdio.h"
4#include "qsutil.h" 4#include "qsutil.h"
5 5
diff --git a/rcpthosts.c b/rcpthosts.c
index 1bc3018..9e8dc66 100644
--- a/rcpthosts.c
+++ b/rcpthosts.c
@@ -6,6 +6,7 @@
6#include "constmap.h" 6#include "constmap.h"
7#include "stralloc.h" 7#include "stralloc.h"
8#include "rcpthosts.h" 8#include "rcpthosts.h"
9#include "case.h"
9 10
10static int flagrh = 0; 11static int flagrh = 0;
11static stralloc rh = {0}; 12static stralloc rh = {0};
diff --git a/realrcptto.c b/realrcptto.c
index 0f275ba..f5f6f15 100644
--- a/realrcptto.c
+++ b/realrcptto.c
@@ -1,5 +1,6 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <unistd.h>
3#include <stdlib.h> 4#include <stdlib.h>
4#include <pwd.h> 5#include <pwd.h>
5#include <string.h> 6#include <string.h>
@@ -19,7 +20,6 @@
19#include "env.h" 20#include "env.h"
20#include "slurpclose.h" 21#include "slurpclose.h"
21#include "control.h" 22#include "control.h"
22#include "readwrite.h"
23 23
24extern void die_nomem(); 24extern void die_nomem();
25extern void die_control(); 25extern void die_control();
@@ -50,6 +50,8 @@ static char remoteipbuf[64]=" ";
50static int flagdenyall; 50static int flagdenyall;
51static int flagdenyany; 51static int flagdenyany;
52 52
53int realrcptto(char *addr, int depth);
54
53void realrcptto_init() 55void realrcptto_init()
54{ 56{
55 char *x; 57 char *x;
@@ -276,16 +278,7 @@ int depth;
276 return 1; 278 return 1;
277} 279}
278 280
279int realrcptto(addr, depth) 281static int realrcptto_ex(addr, depth)
280char *addr;
281int depth;
282{
283 env_unset("DTUSER");
284 extension = NULL;
285 return realrcptto_ex(addr, depth);
286}
287
288int realrcptto_ex(addr, depth)
289char *addr; 282char *addr;
290int depth; 283int depth;
291{ 284{
@@ -476,6 +469,15 @@ int depth;
476 } 469 }
477} 470}
478 471
472int realrcptto(addr, depth)
473char *addr;
474int depth;
475{
476 env_unset("DTUSER");
477 extension = NULL;
478 return realrcptto_ex(addr, depth);
479}
480
479int realrcptto_deny() 481int realrcptto_deny()
480{ 482{
481 return flagdenyall && flagdenyany; 483 return flagdenyall && flagdenyany;
diff --git a/remoteinfo.c b/remoteinfo.c
index c7abd70..45725d2 100644
--- a/remoteinfo.c
+++ b/remoteinfo.c
@@ -2,6 +2,7 @@
2#include <sys/socket.h> 2#include <sys/socket.h>
3#include <netinet/in.h> 3#include <netinet/in.h>
4#include <fcntl.h> 4#include <fcntl.h>
5#include <unistd.h>
5#include "byte.h" 6#include "byte.h"
6#include "substdio.h" 7#include "substdio.h"
7#include "ip.h" 8#include "ip.h"
diff --git a/scan.h b/scan.h
index 53ce703..548d599 100644
--- a/scan.h
+++ b/scan.h
@@ -10,6 +10,7 @@ extern unsigned int scan_nbbshort();
10extern unsigned int scan_ulong(); 10extern unsigned int scan_ulong();
11extern unsigned int scan_xlong(); 11extern unsigned int scan_xlong();
12extern unsigned int scan_nbblong(); 12extern unsigned int scan_nbblong();
13extern unsigned int scan_8long();
13 14
14extern unsigned int scan_plusminus(); 15extern unsigned int scan_plusminus();
15extern unsigned int scan_0x(); 16extern unsigned int scan_0x();
diff --git a/seek_cur.c b/seek_cur.c
index c8a3ee8..9c6b32c 100644
--- a/seek_cur.c
+++ b/seek_cur.c
@@ -1,4 +1,5 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include "seek.h" 3#include "seek.h"
3 4
4#define CUR 1 /* sigh */ 5#define CUR 1 /* sigh */
diff --git a/seek_end.c b/seek_end.c
index 8a7b3c5..10b9190 100644
--- a/seek_end.c
+++ b/seek_end.c
@@ -1,4 +1,5 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include "seek.h" 3#include "seek.h"
3 4
4#define END 2 /* sigh */ 5#define END 2 /* sigh */
diff --git a/seek_set.c b/seek_set.c
index f540664..56088a3 100644
--- a/seek_set.c
+++ b/seek_set.c
@@ -1,4 +1,5 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include "seek.h" 3#include "seek.h"
3 4
4#define SET 0 /* sigh */ 5#define SET 0 /* sigh */
diff --git a/seek_trunc.c b/seek_trunc.c
index 6a1a73e..06ba1d4 100644
--- a/seek_trunc.c
+++ b/seek_trunc.c
@@ -1,4 +1,5 @@
1#include <sys/types.h> 1#include <sys/types.h>
2#include <unistd.h>
2#include "seek.h" 3#include "seek.h"
3 4
4int seek_trunc(fd,pos) int fd; seek_pos pos; 5int seek_trunc(fd,pos) int fd; seek_pos pos;
diff --git a/sendmail.c b/sendmail.c
index c82a536..04c2650 100644
--- a/sendmail.c
+++ b/sendmail.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "sgetopt.h" 2#include "sgetopt.h"
2#include "substdio.h" 3#include "substdio.h"
3#include "subfd.h" 4#include "subfd.h"
@@ -8,7 +9,6 @@
8#include "str.h" 9#include "str.h"
9#include "stralloc.h" 10#include "stralloc.h"
10#include "getln.h" 11#include "getln.h"
11#include "readwrite.h"
12#include "wait.h" 12#include "wait.h"
13#include "fd.h" 13#include "fd.h"
14#include "sig.h" 14#include "sig.h"
diff --git a/slurpclose.c b/slurpclose.c
index 2fcef15..3b3808c 100644
--- a/slurpclose.c
+++ b/slurpclose.c
@@ -1,5 +1,5 @@
1#include <unistd.h>
1#include "stralloc.h" 2#include "stralloc.h"
2#include "readwrite.h"
3#include "slurpclose.h" 3#include "slurpclose.h"
4#include "error.h" 4#include "error.h"
5 5
diff --git a/spawn.c b/spawn.c
index 20e3d16..57e168d 100644
--- a/spawn.c
+++ b/spawn.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include <sys/types.h> 2#include <sys/types.h>
2#include <sys/stat.h> 3#include <sys/stat.h>
3#include "alloc.h" 4#include "alloc.h"
diff --git a/subfd.h b/subfd.h
index bcb2e1e..e58c1c6 100644
--- a/subfd.h
+++ b/subfd.h
@@ -9,7 +9,7 @@ extern substdio *subfdout;
9extern substdio *subfdoutsmall; 9extern substdio *subfdoutsmall;
10extern substdio *subfderr; 10extern substdio *subfderr;
11 11
12extern int subfd_read(); 12extern ssize_t subfd_read();
13extern int subfd_readsmall(); 13extern ssize_t subfd_readsmall();
14 14
15#endif 15#endif
diff --git a/subfderr.c b/subfderr.c
index 011ab0f..bed54f0 100644
--- a/subfderr.c
+++ b/subfderr.c
@@ -1,4 +1,4 @@
1#include "readwrite.h" 1#include <unistd.h>
2#include "substdio.h" 2#include "substdio.h"
3#include "subfd.h" 3#include "subfd.h"
4 4
diff --git a/subfdin.c b/subfdin.c
index a11d323..88fc718 100644
--- a/subfdin.c
+++ b/subfdin.c
@@ -1,8 +1,8 @@
1#include "readwrite.h" 1#include <unistd.h>
2#include "substdio.h" 2#include "substdio.h"
3#include "subfd.h" 3#include "subfd.h"
4 4
5int subfd_read(fd,buf,len) int fd; char *buf; int len; 5ssize_t subfd_read(fd,buf,len) int fd; char *buf; int len;
6{ 6{
7 if (substdio_flush(subfdout) == -1) return -1; 7 if (substdio_flush(subfdout) == -1) return -1;
8 return read(fd,buf,len); 8 return read(fd,buf,len);
diff --git a/subfdins.c b/subfdins.c
index 36983ac..45dc949 100644
--- a/subfdins.c
+++ b/subfdins.c
@@ -1,8 +1,8 @@
1#include "readwrite.h" 1#include <unistd.h>
2#include "substdio.h" 2#include "substdio.h"
3#include "subfd.h" 3#include "subfd.h"
4 4
5int subfd_readsmall(fd,buf,len) int fd; char *buf; int len; 5ssize_t subfd_readsmall(fd,buf,len) int fd; char *buf; int len;
6{ 6{
7 if (substdio_flush(subfdoutsmall) == -1) return -1; 7 if (substdio_flush(subfdoutsmall) == -1) return -1;
8 return read(fd,buf,len); 8 return read(fd,buf,len);
diff --git a/subfdout.c b/subfdout.c
index 0aee102..ac3a008 100644
--- a/subfdout.c
+++ b/subfdout.c
@@ -1,4 +1,4 @@
1#include "readwrite.h" 1#include <unistd.h>
2#include "substdio.h" 2#include "substdio.h"
3#include "subfd.h" 3#include "subfd.h"
4 4
diff --git a/subfdouts.c b/subfdouts.c
index 5be356d..e9c47c1 100644
--- a/subfdouts.c
+++ b/subfdouts.c
@@ -1,4 +1,4 @@
1#include "readwrite.h" 1#include <unistd.h>
2#include "substdio.h" 2#include "substdio.h"
3#include "subfd.h" 3#include "subfd.h"
4 4
diff --git a/substdio.c b/substdio.c
index d03dff2..4c1bb97 100644
--- a/substdio.c
+++ b/substdio.c
@@ -2,7 +2,7 @@
2 2
3void substdio_fdbuf(s,op,fd,buf,len) 3void substdio_fdbuf(s,op,fd,buf,len)
4register substdio *s; 4register substdio *s;
5register int (*op)(); 5register ssize_t (*op)();
6register int fd; 6register int fd;
7register char *buf; 7register char *buf;
8register int len; 8register int len;
diff --git a/substdio.h b/substdio.h
index c3f7f7d..bb9dac9 100644
--- a/substdio.h
+++ b/substdio.h
@@ -1,12 +1,14 @@
1#ifndef SUBSTDIO_H 1#ifndef SUBSTDIO_H
2#define SUBSTDIO_H 2#define SUBSTDIO_H
3 3
4#include <unistd.h>
5
4typedef struct substdio { 6typedef struct substdio {
5 char *x; 7 char *x;
6 int p; 8 int p;
7 int n; 9 int n;
8 int fd; 10 int fd;
9 int (*op)(); 11 ssize_t (*op)();
10} substdio; 12} substdio;
11 13
12#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) } 14#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
diff --git a/tcp-env.c b/tcp-env.c
index feb85cc..ca15088 100644
--- a/tcp-env.c
+++ b/tcp-env.c
@@ -2,6 +2,7 @@
2#include <sys/socket.h> 2#include <sys/socket.h>
3#include <sys/param.h> 3#include <sys/param.h>
4#include <netinet/in.h> 4#include <netinet/in.h>
5#include <unistd.h>
5#include "sig.h" 6#include "sig.h"
6#include "stralloc.h" 7#include "stralloc.h"
7#include "str.h" 8#include "str.h"
diff --git a/tcpto.c b/tcpto.c
index 8d100d5..2582cfb 100644
--- a/tcpto.c
+++ b/tcpto.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "tcpto.h" 2#include "tcpto.h"
2#include "open.h" 3#include "open.h"
3#include "lock.h" 4#include "lock.h"
@@ -6,7 +7,6 @@
6#include "ip.h" 7#include "ip.h"
7#include "byte.h" 8#include "byte.h"
8#include "datetime.h" 9#include "datetime.h"
9#include "readwrite.h"
10 10
11char tcpto_buf[1024]; 11char tcpto_buf[1024];
12 12
diff --git a/tcpto_clean.c b/tcpto_clean.c
index ed48506..ba246c2 100644
--- a/tcpto_clean.c
+++ b/tcpto_clean.c
@@ -1,7 +1,7 @@
1#include <unistd.h>
1#include "tcpto.h" 2#include "tcpto.h"
2#include "open.h" 3#include "open.h"
3#include "substdio.h" 4#include "substdio.h"
4#include "readwrite.h"
5 5
6char tcpto_cleanbuf[1024]; 6char tcpto_cleanbuf[1024];
7 7
diff --git a/timeoutconn.c b/timeoutconn.c
index 33a16d9..e6d5f19 100644
--- a/timeoutconn.c
+++ b/timeoutconn.c
@@ -2,10 +2,10 @@
2#include <sys/socket.h> 2#include <sys/socket.h>
3#include <netinet/in.h> 3#include <netinet/in.h>
4#include <arpa/inet.h> 4#include <arpa/inet.h>
5#include <unistd.h>
5#include "ndelay.h" 6#include "ndelay.h"
6#include "select.h" 7#include "select.h"
7#include "error.h" 8#include "error.h"
8#include "readwrite.h"
9#include "ip.h" 9#include "ip.h"
10#include "byte.h" 10#include "byte.h"
11#include "timeoutconn.h" 11#include "timeoutconn.h"
diff --git a/timeoutread.c b/timeoutread.c
index c75e29c..a730ba2 100644
--- a/timeoutread.c
+++ b/timeoutread.c
@@ -1,9 +1,9 @@
1#include <unistd.h>
1#include "timeoutread.h" 2#include "timeoutread.h"
2#include "select.h" 3#include "select.h"
3#include "error.h" 4#include "error.h"
4#include "readwrite.h"
5 5
6int timeoutread(t,fd,buf,len) int t; int fd; char *buf; int len; 6ssize_t timeoutread(t,fd,buf,len) int t; int fd; char *buf; int len;
7{ 7{
8 fd_set rfds; 8 fd_set rfds;
9 struct timeval tv; 9 struct timeval tv;
diff --git a/timeoutread.h b/timeoutread.h
index 20d3bfc..13a525f 100644
--- a/timeoutread.h
+++ b/timeoutread.h
@@ -1,6 +1,6 @@
1#ifndef TIMEOUTREAD_H 1#ifndef TIMEOUTREAD_H
2#define TIMEOUTREAD_H 2#define TIMEOUTREAD_H
3 3
4extern int timeoutread(); 4extern ssize_t timeoutread();
5 5
6#endif 6#endif
diff --git a/timeoutwrite.c b/timeoutwrite.c
index 516d283..2ec7641 100644
--- a/timeoutwrite.c
+++ b/timeoutwrite.c
@@ -1,7 +1,7 @@
1#include <unistd.h>
1#include "timeoutwrite.h" 2#include "timeoutwrite.h"
2#include "select.h" 3#include "select.h"
3#include "error.h" 4#include "error.h"
4#include "readwrite.h"
5 5
6int timeoutwrite(t,fd,buf,len) int t; int fd; char *buf; int len; 6int timeoutwrite(t,fd,buf,len) int t; int fd; char *buf; int len;
7{ 7{
diff --git a/trigger.c b/trigger.c
index 39f81b8..82f7e28 100644
--- a/trigger.c
+++ b/trigger.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "select.h" 2#include "select.h"
2#include "open.h" 3#include "open.h"
3#include "trigger.h" 4#include "trigger.h"
diff --git a/triggerpull.c b/triggerpull.c
index 30b9a97..efa200b 100644
--- a/triggerpull.c
+++ b/triggerpull.c
@@ -1,3 +1,4 @@
1#include <unistd.h>
1#include "ndelay.h" 2#include "ndelay.h"
2#include "open.h" 3#include "open.h"
3#include "triggerpull.h" 4#include "triggerpull.h"