fix OS_chmod uses read or write access.
@@ -201,9 +201,13 @@ int32 OS_FileChmod_Impl(const char *local_path, uint32 access)
/* Open file to avoid filename race potential */
fd = open(local_path, O_RDONLY, 0);
if (fd < 0)
+ {
+ fd = open(local_path, O_WRONLY, 0);
+ if (fd < 0)
{
return OS_ERROR;
}
+ }
/*
* In order to preserve any OTHER mode bits,
