Skip to content
Snippets Groups Projects
Commit ee85e4a1 authored by rswindell's avatar rswindell
Browse files

MKDIR -> mkpath

parent 30904abf
No related branches found
No related tags found
No related merge requests found
......@@ -1141,7 +1141,7 @@ int create_netmail(const char *to, const smbmsg_t* msg, const char *subject, con
nodecfg=findnodecfg(&cfg, dest, /* skip exact match: */2);
}
if(!isdir(scfg.netmail_dir) && MKDIR(scfg.netmail_dir) != 0) {
if(!isdir(scfg.netmail_dir) && mkpath(scfg.netmail_dir) != 0) {
lprintf(LOG_ERR, "Error %u (%s) line %d creating directory: %s", errno, strerror(errno), __LINE__, scfg.netmail_dir);
return -2;
}
......@@ -4296,7 +4296,7 @@ int pkt_to_msg(FILE* fidomsg, fmsghdr_t* hdr, const char* info, const char* inbo
printf("Empty NetMail");
else {
printf("Exporting: ");
if(!isdir(scfg.netmail_dir) && MKDIR(scfg.netmail_dir) != 0) {
if(!isdir(scfg.netmail_dir) && mkpath(scfg.netmail_dir) != 0) {
lprintf(LOG_ERR, "Error %u (%s) line %d creating directory: %s"
,errno, strerror(errno), __LINE__, scfg.netmail_dir);
free(fmsgbuf);
......@@ -4610,7 +4610,7 @@ int import_netmail(const char* path, fmsghdr_t hdr, FILE* fp, const char* inboun
SAFEPRINTF2(str,"%s%s", inbound, tp);
}
SAFEPRINTF2(tmp,"%sfile/%04u.in",scfg.data_dir,usernumber);
MKDIR(tmp);
mkpath(tmp);
backslash(tmp);
strcat(tmp,tp);
mv(str,tmp,0);
......@@ -5275,7 +5275,7 @@ int export_netmail(void)
lprintf(LOG_DEBUG, "MIME attachment decoded: %s (%lu bytes)", filename, (ulong)filelen);
char outdir[MAX_PATH+1];
SAFEPRINTF2(outdir, "%sfile/%04u.out", scfg.data_dir, msg.idx.from);
MKDIR(outdir);
mkpath(outdir);
char fpath[MAX_PATH+1];
SAFEPRINTF2(fpath, "%s/%s", outdir, filename);
FILE* fp = fopen(fpath, "wb");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment