1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

file: yet another fix for directory creation

This commit is contained in:
Steffen Vogel 2018-10-21 11:01:15 +02:00
parent 2a0f745434
commit 4f85e7b82c

View file

@ -218,12 +218,12 @@ int file_start(struct node *n)
ret = stat(dir, &sb);
if (ret) {
if (errno == ENOENT && errno == ENOTDIR) {
if (errno == ENOENT || errno == ENOTDIR) {
ret = mkdir(dir, 0644);
if (ret)
serror("Failed to create directory");
}
else
else if (errno != EISDIR)
serror("Failed to stat");
}
else if (!S_ISDIR(sb.st_mode)) {