Directory creation fix
Signed-off-by: Tyrolyean <tyrolyean@tyrolyean.net>
This commit is contained in:
parent
fa6027c437
commit
12285aaf8c
1 changed files with 4 additions and 5 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
/* Generates an email struct from the given eml text. If the content is
|
/* Generates an email struct from the given eml text. If the content is
|
||||||
* multipart, it will be slit up into several email_ts. This expansion is done
|
* multipart, it will be slit up into several email_ts. This expansion is done
|
||||||
|
@ -345,14 +346,12 @@ int replace_files(struct email_t* mail, const char* dirname, bool* created){
|
||||||
min_filesize ){
|
min_filesize ){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(!*created){
|
if(mkdir(directory, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0){
|
||||||
*created = true;
|
|
||||||
if(mkdir(directory, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
|
if(errno != EEXIST){
|
||||||
< 0){
|
|
||||||
|
|
||||||
perror("Failed to create storage directory!");
|
perror("Failed to create storage directory!");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue