diff options
Diffstat (limited to 'qmail-qmtpd.c')
| -rw-r--r-- | qmail-qmtpd.c | 14 |
1 files changed, 8 insertions, 6 deletions
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 | } |
