summaryrefslogtreecommitdiffstats
path: root/maildirmake.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
committermanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
commit69aec538b456402170dc723af417ba5c05389c32 (patch)
treee6f34c543f17c6392447ea337b2e2868212424d1 /maildirmake.c
downloadqmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz
qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2
qmail-69aec538b456402170dc723af417ba5c05389c32.zip
qmail 1.03 import
Diffstat (limited to 'maildirmake.c')
-rw-r--r--maildirmake.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/maildirmake.c b/maildirmake.c
new file mode 100644
index 0000000..9863fef
--- /dev/null
+++ b/maildirmake.c
@@ -0,0 +1,24 @@
1#include "strerr.h"
2#include "exit.h"
3
4#define FATAL "maildirmake: fatal: "
5
6void main(argc,argv)
7int argc;
8char **argv;
9{
10 umask(077);
11 if (!argv[1])
12 strerr_die1x(100,"maildirmake: usage: maildirmake name");
13 if (mkdir(argv[1],0700) == -1)
14 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],": ");
15 if (chdir(argv[1]) == -1)
16 strerr_die4sys(111,FATAL,"unable to chdir to ",argv[1],": ");
17 if (mkdir("tmp",0700) == -1)
18 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/tmp: ");
19 if (mkdir("new",0700) == -1)
20 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/new: ");
21 if (mkdir("cur",0700) == -1)
22 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/cur: ");
23 _exit(0);
24}