diff options
| author | Manuel Mausz <manuel@mausz.at> | 2019-06-11 15:28:27 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2019-06-11 15:29:11 +0200 |
| commit | 692760720b197b46e8e4268bede8cad6f90399aa (patch) | |
| tree | 0d0d5f45759b83e15d6668357f9482dca236880b | |
| parent | 54bb1142daa7c25f626176bb9357e1fc7ca75fbb (diff) | |
| download | qmail-692760720b197b46e8e4268bede8cad6f90399aa.tar.gz qmail-692760720b197b46e8e4268bede8cad6f90399aa.tar.bz2 qmail-692760720b197b46e8e4268bede8cad6f90399aa.zip | |
Fix compile warnings...
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | auto-gid.c | 2 | ||||
| -rw-r--r-- | auto-int.c | 2 | ||||
| -rw-r--r-- | auto-int8.c | 2 | ||||
| -rw-r--r-- | auto-str.c | 2 | ||||
| -rw-r--r-- | auto-uid.c | 2 | ||||
| -rw-r--r-- | bouncesaying.c | 1 | ||||
| -rw-r--r-- | cdb_seek.c | 1 | ||||
| -rw-r--r-- | cdbmss.c | 3 | ||||
| -rw-r--r-- | cdbmss.h | 4 | ||||
| -rw-r--r-- | chkshsgr.c | 6 | ||||
| -rw-r--r-- | condredirect.c | 4 | ||||
| -rw-r--r-- | control.c | 2 | ||||
| -rw-r--r-- | dnscname.c | 2 | ||||
| -rw-r--r-- | dnsmxip.c | 1 | ||||
| -rw-r--r-- | except.c | 1 | ||||
| -rw-r--r-- | fd_copy.c | 1 | ||||
| -rw-r--r-- | fd_move.c | 1 | ||||
| -rw-r--r-- | forward.c | 4 | ||||
| -rw-r--r-- | hostname.c | 2 | ||||
| -rw-r--r-- | idedit.c | 3 | ||||
| -rw-r--r-- | install.c | 4 | ||||
| -rw-r--r-- | instcheck.c | 2 | ||||
| -rw-r--r-- | ipme.c | 1 | ||||
| -rw-r--r-- | maildir.c | 1 | ||||
| -rw-r--r-- | maildir2mbox.c | 5 | ||||
| -rw-r--r-- | maildirgetquota.c | 2 | ||||
| -rw-r--r-- | maildirmake.c | 3 | ||||
| -rw-r--r-- | maildirmisc.h | 2 | ||||
| -rw-r--r-- | maildiropen.c | 2 | ||||
| -rw-r--r-- | maildirquota.c | 6 | ||||
| -rw-r--r-- | maildirwatch.c | 2 | ||||
| -rw-r--r-- | newfield.c | 1 | ||||
| -rw-r--r-- | overmaildirquota.c | 11 | ||||
| -rw-r--r-- | predate.c | 3 | ||||
| -rw-r--r-- | preline.c | 2 | ||||
| -rw-r--r-- | prot.c | 3 | ||||
| -rw-r--r-- | qbiff.c | 2 | ||||
| -rw-r--r-- | qmail-clean.c | 2 | ||||
| -rw-r--r-- | qmail-getpw.c | 2 | ||||
| -rw-r--r-- | qmail-inject.c | 1 | ||||
| -rw-r--r-- | qmail-local.c | 4 | ||||
| -rw-r--r-- | qmail-lspawn.c | 3 | ||||
| -rw-r--r-- | qmail-newbrt.c | 6 | ||||
| -rw-r--r-- | qmail-newmrh.c | 6 | ||||
| -rw-r--r-- | qmail-newu.c | 6 | ||||
| -rw-r--r-- | qmail-pop3d.c | 11 | ||||
| -rw-r--r-- | qmail-popup.c | 10 | ||||
| -rw-r--r-- | qmail-pw2u.c | 3 | ||||
| -rw-r--r-- | qmail-qmqpc.c | 13 | ||||
| -rw-r--r-- | qmail-qmqpd.c | 15 | ||||
| -rw-r--r-- | qmail-qmtpd.c | 14 | ||||
| -rw-r--r-- | qmail-qread.c | 2 | ||||
| -rw-r--r-- | qmail-queue.c | 2 | ||||
| -rw-r--r-- | qmail-remote.c | 10 | ||||
| -rw-r--r-- | qmail-rspawn.c | 1 | ||||
| -rw-r--r-- | qmail-send.c | 9 | ||||
| -rw-r--r-- | qmail-showctl.c | 1 | ||||
| -rw-r--r-- | qmail-smtpd.c | 11 | ||||
| -rw-r--r-- | qmail-spp.c | 2 | ||||
| -rw-r--r-- | qmail-start.c | 3 | ||||
| -rw-r--r-- | qmail-tcpok.c | 2 | ||||
| -rw-r--r-- | qmail-tcpto.c | 3 | ||||
| -rw-r--r-- | qmail.c | 2 | ||||
| -rw-r--r-- | qsmhook.c | 2 | ||||
| -rw-r--r-- | qsutil.c | 2 | ||||
| -rw-r--r-- | rcpthosts.c | 1 | ||||
| -rw-r--r-- | realrcptto.c | 24 | ||||
| -rw-r--r-- | remoteinfo.c | 1 | ||||
| -rw-r--r-- | scan.h | 1 | ||||
| -rw-r--r-- | seek_cur.c | 1 | ||||
| -rw-r--r-- | seek_end.c | 1 | ||||
| -rw-r--r-- | seek_set.c | 1 | ||||
| -rw-r--r-- | seek_trunc.c | 1 | ||||
| -rw-r--r-- | sendmail.c | 2 | ||||
| -rw-r--r-- | slurpclose.c | 2 | ||||
| -rw-r--r-- | spawn.c | 1 | ||||
| -rw-r--r-- | subfd.h | 4 | ||||
| -rw-r--r-- | subfderr.c | 2 | ||||
| -rw-r--r-- | subfdin.c | 4 | ||||
| -rw-r--r-- | subfdins.c | 4 | ||||
| -rw-r--r-- | subfdout.c | 2 | ||||
| -rw-r--r-- | subfdouts.c | 2 | ||||
| -rw-r--r-- | substdio.c | 2 | ||||
| -rw-r--r-- | substdio.h | 4 | ||||
| -rw-r--r-- | tcp-env.c | 1 | ||||
| -rw-r--r-- | tcpto.c | 2 | ||||
| -rw-r--r-- | tcpto_clean.c | 2 | ||||
| -rw-r--r-- | timeoutconn.c | 2 | ||||
| -rw-r--r-- | timeoutread.c | 4 | ||||
| -rw-r--r-- | timeoutread.h | 2 | ||||
| -rw-r--r-- | timeoutwrite.c | 2 | ||||
| -rw-r--r-- | trigger.c | 1 | ||||
| -rw-r--r-- | triggerpull.c | 1 |
94 files changed, 200 insertions, 124 deletions
| @@ -29,6 +29,7 @@ case_diffs.o | |||
| 29 | case_lowerb.o | 29 | case_lowerb.o |
| 30 | case_lowers.o | 30 | case_lowers.o |
| 31 | case_starts.o | 31 | case_starts.o |
| 32 | case_startb.o | ||
| 32 | case.a | 33 | case.a |
| 33 | getln.o | 34 | getln.o |
| 34 | getln2.o | 35 | getln2.o |
| @@ -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" |
| @@ -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" |
| @@ -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 | ||
| 5 | char buf1[256]; | 5 | char buf1[256]; |
| @@ -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" |
| @@ -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 | ||
| @@ -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" |
| @@ -13,4 +13,8 @@ struct cdbmss { | |||
| 13 | int fd; | 13 | int fd; |
| 14 | } ; | 14 | } ; |
| 15 | 15 | ||
| 16 | int cdbmss_start(struct cdbmss *c, int fd); | ||
| 17 | int cdbmss_add(struct cdbmss *c, unsigned char *key, unsigned int keylen, | ||
| 18 | unsigned char *data, unsigned int datalen); | ||
| 19 | int cdbmss_finish(struct cdbmss *c); | ||
| 16 | #endif | 20 | #endif |
| @@ -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 | |||
| 2 | void main() | 6 | void 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 | ||
| 16 | struct qmail qqt; | 16 | struct qmail qqt; |
| 17 | 17 | ||
| 18 | int mywrite(fd,buf,len) int fd; char *buf; int len; | 18 | ssize_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; |
| @@ -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" |
| @@ -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 | ||
| 9 | stralloc sa = {0}; | 9 | stralloc sa = {0}; |
| @@ -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" |
| @@ -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" |
| @@ -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 | ||
| 4 | int fd_copy(to,from) | 5 | int fd_copy(to,from) |
| @@ -1,3 +1,4 @@ | |||
| 1 | #include <unistd.h> | ||
| 1 | #include "fd.h" | 2 | #include "fd.h" |
| 2 | 3 | ||
| 3 | int fd_move(to,from) | 4 | int fd_move(to,from) |
| @@ -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 | ||
| 14 | struct qmail qqt; | 14 | struct qmail qqt; |
| 15 | 15 | ||
| 16 | int mywrite(fd,buf,len) int fd; char *buf; int len; | 16 | ssize_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; |
| @@ -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 | ||
| 6 | char host[256]; | 6 | char host[256]; |
| @@ -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: " |
| @@ -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 | ||
| 8 | extern void hier(); | 10 | extern 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 | ||
| 8 | extern void hier(); | 8 | extern void hier(); |
| @@ -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" |
| @@ -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 | ||
| 137 | int maildir_hasflag(const char *filename, char); | 137 | int maildir_hasflag(const char *filename, char); |
| 138 | 138 | ||
| 139 | int 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" |
| @@ -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 | ||
| 15 | static const char rcsid[]="$Id: overquota.c,v 1.0 2002/06/09 16:21:05 mr \ | 16 | static const char rcsid[]="$Id: overquota.c,v 1.0 2002/06/09 16:21:05 mr \ |
| 16 | sam Exp $"; | 17 | sam Exp $"; |
| @@ -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 | ||
| @@ -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" |
| @@ -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 | ||
| @@ -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 | ||
| 32 | void usage() { strerr_die1x(100,"qmail-local: usage: qmail-local [ -nN ] user homedir local dash ext domain sender aliasempty"); } | 34 | void 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 | ||
| 17 | char *aliasempty; | 20 | char *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 | ||
| 13 | void die_temp() { _exit(111); } | 17 | void 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 | ||
| 25 | void die() { _exit(0); } | 26 | void die() { _exit(0); } |
| 26 | 27 | ||
| 27 | int saferead(fd,buf,len) int fd; char *buf; int len; | 28 | ssize_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 | ||
| 35 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 36 | ssize_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 | ||
| 17 | void die() { _exit(1); } | 17 | void die() { _exit(1); } |
| 18 | 18 | ||
| 19 | int saferead(fd,buf,len) int fd; char *buf; int len; | 19 | ssize_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 | ||
| 27 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 27 | ssize_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 | ||
| 21 | void die_chdir() | 22 | void 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); } | |||
| 34 | int lasterror = 55; | 34 | int lasterror = 55; |
| 35 | int qmqpfd; | 35 | int qmqpfd; |
| 36 | 36 | ||
| 37 | int saferead(fd,buf,len) int fd; char *buf; int len; | 37 | ssize_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 | } |
| 44 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 44 | ssize_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 | ||
| 136 | stralloc servers = {0}; | 136 | stralloc servers = {0}; |
| 137 | 137 | ||
| 138 | main() | 138 | int 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 | ||
| 12 | void resources() { _exit(111); } | 14 | void resources() { _exit(111); } |
| 13 | 15 | ||
| 14 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 16 | ssize_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 | } |
| 21 | int saferead(fd,buf,len) int fd; char *buf; int len; | 23 | ssize_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 | ||
| 106 | int flagok = 1; | 108 | int flagok = 1; |
| 107 | 109 | ||
| 108 | main() | 110 | int 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 | ||
| 16 | void badproto() { _exit(100); } | 17 | void badproto() { _exit(100); } |
| 17 | void resources() { _exit(111); } | 18 | void resources() { _exit(111); } |
| @@ -25,9 +26,9 @@ extern void realrcptto_start(); | |||
| 25 | extern int realrcptto(); | 26 | extern int realrcptto(); |
| 26 | extern int realrcptto_deny(); | 27 | extern int realrcptto_deny(); |
| 27 | 28 | ||
| 28 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 29 | ssize_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; | |||
| 36 | char ssoutbuf[256]; | 37 | char ssoutbuf[256]; |
| 37 | substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf); | 38 | substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf); |
| 38 | 39 | ||
| 39 | int saferead(fd,buf,len) int fd; char *buf; int len; | 40 | ssize_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}; | |||
| 84 | char *relayclient; | 85 | char *relayclient; |
| 85 | int relayclientlen; | 86 | int relayclientlen; |
| 86 | 87 | ||
| 87 | main() | 88 | int 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; | |||
| 161 | int smtpfd; | 161 | int smtpfd; |
| 162 | int timeout = 1200; | 162 | int timeout = 1200; |
| 163 | 163 | ||
| 164 | int saferead(fd,buf,len) int fd; char *buf; int len; | 164 | ssize_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 | } |
| 177 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 177 | ssize_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; | |||
| 86 | int flagauth = 0; | 87 | int flagauth = 0; |
| 87 | char **childargs; | 88 | char **childargs; |
| 88 | 89 | ||
| 89 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 90 | ssize_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 | ||
| 799 | int saferead(fd,buf,len) int fd; char *buf; int len; | 800 | ssize_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 | ||
| 14 | void die(n) int n; { substdio_flush(subfdout); _exit(n); } | 17 | void die(n) int n; { substdio_flush(subfdout); _exit(n); } |
| 15 | 18 | ||
| @@ -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" |
| @@ -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" |
| @@ -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 | ||
| 10 | static int flagrh = 0; | 11 | static int flagrh = 0; |
| 11 | static stralloc rh = {0}; | 12 | static 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 | ||
| 24 | extern void die_nomem(); | 24 | extern void die_nomem(); |
| 25 | extern void die_control(); | 25 | extern void die_control(); |
| @@ -50,6 +50,8 @@ static char remoteipbuf[64]=" "; | |||
| 50 | static int flagdenyall; | 50 | static int flagdenyall; |
| 51 | static int flagdenyany; | 51 | static int flagdenyany; |
| 52 | 52 | ||
| 53 | int realrcptto(char *addr, int depth); | ||
| 54 | |||
| 53 | void realrcptto_init() | 55 | void 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 | ||
| 279 | int realrcptto(addr, depth) | 281 | static int realrcptto_ex(addr, depth) |
| 280 | char *addr; | ||
| 281 | int depth; | ||
| 282 | { | ||
| 283 | env_unset("DTUSER"); | ||
| 284 | extension = NULL; | ||
| 285 | return realrcptto_ex(addr, depth); | ||
| 286 | } | ||
| 287 | |||
| 288 | int realrcptto_ex(addr, depth) | ||
| 289 | char *addr; | 282 | char *addr; |
| 290 | int depth; | 283 | int depth; |
| 291 | { | 284 | { |
| @@ -476,6 +469,15 @@ int depth; | |||
| 476 | } | 469 | } |
| 477 | } | 470 | } |
| 478 | 471 | ||
| 472 | int realrcptto(addr, depth) | ||
| 473 | char *addr; | ||
| 474 | int depth; | ||
| 475 | { | ||
| 476 | env_unset("DTUSER"); | ||
| 477 | extension = NULL; | ||
| 478 | return realrcptto_ex(addr, depth); | ||
| 479 | } | ||
| 480 | |||
| 479 | int realrcptto_deny() | 481 | int 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" |
| @@ -10,6 +10,7 @@ extern unsigned int scan_nbbshort(); | |||
| 10 | extern unsigned int scan_ulong(); | 10 | extern unsigned int scan_ulong(); |
| 11 | extern unsigned int scan_xlong(); | 11 | extern unsigned int scan_xlong(); |
| 12 | extern unsigned int scan_nbblong(); | 12 | extern unsigned int scan_nbblong(); |
| 13 | extern unsigned int scan_8long(); | ||
| 13 | 14 | ||
| 14 | extern unsigned int scan_plusminus(); | 15 | extern unsigned int scan_plusminus(); |
| 15 | extern unsigned int scan_0x(); | 16 | extern unsigned int scan_0x(); |
| @@ -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 */ |
| @@ -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 */ |
| @@ -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 | ||
| 4 | int seek_trunc(fd,pos) int fd; seek_pos pos; | 5 | int seek_trunc(fd,pos) int fd; seek_pos pos; |
| @@ -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 | ||
| @@ -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" |
| @@ -9,7 +9,7 @@ extern substdio *subfdout; | |||
| 9 | extern substdio *subfdoutsmall; | 9 | extern substdio *subfdoutsmall; |
| 10 | extern substdio *subfderr; | 10 | extern substdio *subfderr; |
| 11 | 11 | ||
| 12 | extern int subfd_read(); | 12 | extern ssize_t subfd_read(); |
| 13 | extern int subfd_readsmall(); | 13 | extern ssize_t subfd_readsmall(); |
| 14 | 14 | ||
| 15 | #endif | 15 | #endif |
| @@ -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 | ||
| @@ -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 | ||
| 5 | int subfd_read(fd,buf,len) int fd; char *buf; int len; | 5 | ssize_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); |
| @@ -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 | ||
| 5 | int subfd_readsmall(fd,buf,len) int fd; char *buf; int len; | 5 | ssize_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); |
| @@ -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 | ||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | void substdio_fdbuf(s,op,fd,buf,len) | 3 | void substdio_fdbuf(s,op,fd,buf,len) |
| 4 | register substdio *s; | 4 | register substdio *s; |
| 5 | register int (*op)(); | 5 | register ssize_t (*op)(); |
| 6 | register int fd; | 6 | register int fd; |
| 7 | register char *buf; | 7 | register char *buf; |
| 8 | register int len; | 8 | register int len; |
| @@ -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 | |||
| 4 | typedef struct substdio { | 6 | typedef 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) } |
| @@ -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" |
| @@ -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 | ||
| 11 | char tcpto_buf[1024]; | 11 | char 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 | ||
| 6 | char tcpto_cleanbuf[1024]; | 6 | char 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 | ||
| 6 | int timeoutread(t,fd,buf,len) int t; int fd; char *buf; int len; | 6 | ssize_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 | ||
| 4 | extern int timeoutread(); | 4 | extern 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 | ||
| 6 | int timeoutwrite(t,fd,buf,len) int t; int fd; char *buf; int len; | 6 | int timeoutwrite(t,fd,buf,len) int t; int fd; char *buf; int len; |
| 7 | { | 7 | { |
| @@ -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" |
