summaryrefslogtreecommitdiffstats
path: root/tcpto_clean.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcpto_clean.c')
-rw-r--r--tcpto_clean.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tcpto_clean.c b/tcpto_clean.c
new file mode 100644
index 0000000..ed48506
--- /dev/null
+++ b/tcpto_clean.c
@@ -0,0 +1,20 @@
1#include "tcpto.h"
2#include "open.h"
3#include "substdio.h"
4#include "readwrite.h"
5
6char tcpto_cleanbuf[1024];
7
8void tcpto_clean() /* running from queue/mess */
9{
10 int fd;
11 int i;
12 substdio ss;
13
14 fd = open_write("../lock/tcpto");
15 if (fd == -1) return;
16 substdio_fdbuf(&ss,write,fd,tcpto_cleanbuf,sizeof(tcpto_cleanbuf));
17 for (i = 0;i < sizeof(tcpto_cleanbuf);++i) substdio_put(&ss,"",1);
18 substdio_flush(&ss); /* if it fails, bummer */
19 close(fd);
20}