Merge remote-tracking branch 'freemine/fix_unnecessary_mkdir_failure' into doc/contrib
This commit is contained in:
commit
25176bb477
|
@ -223,12 +223,17 @@ int32_t taosMulModeMkDir(const char *dirname, int mode, bool checkAccess) {
|
|||
if (checkAccess && taosCheckAccessFile(temp, TD_FILE_ACCESS_EXIST_OK | TD_FILE_ACCESS_READ_OK | TD_FILE_ACCESS_WRITE_OK)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
code = chmod(temp, mode);
|
||||
if (-1 == code) {
|
||||
struct stat statbuf = {0};
|
||||
code = stat(temp, &statbuf);
|
||||
if (code != 0 || (statbuf.st_mode & mode) != mode) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strncmp(temp, TD_DIRSEP, 1) == 0) {
|
||||
pos += 1;
|
||||
|
|
Loading…
Reference in New Issue