Preserve file permissions on Unix FileImpl::copyToImpl

This commit is contained in:
Mike Naquin 2013-07-25 13:33:21 -05:00
parent fd6433eb4e
commit 8f15c1cf24

View File

@ -341,7 +341,7 @@ void FileImpl::copyToImpl(const std::string& path) const
}
const long blockSize = st.st_blksize;
int dd = open(path.c_str(), O_CREAT | O_TRUNC | O_WRONLY, st.st_mode & S_IRWXU);
int dd = open(path.c_str(), O_CREAT | O_TRUNC | O_WRONLY, st.st_mode);
if (dd == -1)
{
close(sd);