]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/mailbox.c
Factor mailbox_create() out of nat_reset() and files.c
[empserver] / src / lib / common / mailbox.c
index 6910327f006b95364556b30aea642f549d9a2e77..c749eddd7bda635af6f3355483a05999e800023e 100644 (file)
@@ -33,6 +33,9 @@
 #include <config.h>
 
 #include <stdio.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "optlist.h"
 #include "tel.h"
 #include "prototypes.h"
@@ -44,6 +47,16 @@ mailbox(char *buf, natid cn)
     return buf;
 }
 
+/*
+ * Create an empty telegram file named MBOX.
+ */
+int
+mailbox_create(char *mbox)
+{
+    close(creat(mbox, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
+    return 0;
+}
+
 /*
  * Read telegram header from FP into TEL.
  * MBOX is the file name, it is used for logging errors.