Merge pull request #5714 from UiPath/fix-mkdir

runtime: don't fail mkdir if the folder is already created by another process
This commit is contained in:
Peng Tao 2022-11-25 17:52:56 +08:00 committed by GitHub
commit e32c023d96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -399,7 +399,7 @@ func MkdirAllWithInheritedOwner(path string, perm os.FileMode) error {
info, err := os.Stat(curPath)
if err != nil {
if err = os.Mkdir(curPath, perm); err != nil {
if err = os.MkdirAll(curPath, perm); err != nil {
return fmt.Errorf("mkdir call failed: %v", err.Error())
}
if err = syscall.Chown(curPath, uid, gid); err != nil {