s/qmail
4.2.29a
Next generation secure email transport
Loading...
Searching...
No Matches
sqmail-4.2.29a
src
qmail-tcpok.c
Go to the documentation of this file.
1
#include "logmsg.h"
2
#include "buffer.h"
3
#include "lock.h"
4
#include "open.h"
5
#include <unistd.h>
6
#include "
auto_qmail.h
"
7
#include "
exit.h
"
8
9
#define WHO "qmail-tcpok"
10
11
char
buf
[1024];
/* XXX: must match size in tcpto_clean.c, tcpto.c */
12
buffer
bo
;
13
14
int
main
()
15
{
16
int
fd
;
17
int
i;
18
19
if
(chdir(
auto_qmail
) == -1)
20
logmsg(
WHO
,111,FATAL,B(
"unable to chdir to: "
,
auto_qmail
));
21
if
(chdir(
"queue/lock"
) == -1)
22
logmsg(
WHO
,111,FATAL,B(
"unable to chdir to "
,
auto_qmail
,
"/queue/lock: "
));
23
24
fd
= open_write(
"tcpto"
);
25
if
(
fd
== -1)
26
logmsg(
WHO
,111,FATAL,B(
"unable to write "
,
auto_qmail
,
"/queue/lock/tcpto: "
));
27
if
(lock_ex(
fd
) == -1)
28
logmsg(
WHO
,111,FATAL,B(
"unable to lock "
,
auto_qmail
,
"/queue/lock/tcpto: "
));
29
30
buffer_init(&
bo
,
write
,
fd
,
buf
,
sizeof
(
buf
));
31
for
(i = 0; i <
sizeof
(
buf
); ++i)
32
buffer_put(&
bo
,
""
,1);
33
if
(buffer_flush(&
bo
) == -1)
34
logmsg(
WHO
,111,FATAL,B(
"unable to clear "
,
auto_qmail
,
"/queue/lock/tcpto: "
));
35
_exit
(0);
36
}
auto_qmail.h
auto_qmail
char auto_qmail[]
exit.h
_exit
void _exit()
fd
int fd
Definition:
qmail-badloadertypes.c:30
buf
char buf[1024]
Definition:
qmail-tcpok.c:11
bo
buffer bo
Definition:
qmail-tcpok.c:12
WHO
#define WHO
Definition:
qmail-tcpok.c:9
main
int main()
Definition:
qmail-tcpok.c:14
write
void write()
Generated on Thu Feb 29 2024 20:44:53 for s/qmail by
1.9.6