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 <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* 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
|
||||
|
@ -345,14 +346,12 @@ int replace_files(struct email_t* mail, const char* dirname, bool* created){
|
|||
min_filesize ){
|
||||
return 0;
|
||||
}
|
||||
if(!*created){
|
||||
*created = true;
|
||||
if(mkdir(directory, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
|
||||
< 0){
|
||||
if(mkdir(directory, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0){
|
||||
|
||||
if(errno != EEXIST){
|
||||
|
||||
perror("Failed to create storage directory!");
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue