1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 00:32:27 +02:00

Provide file permissions for newly created file

Since O_CREAT is passed, we have to provide permission flags too.
This commit is contained in:
Maarten ter Huurne 2014-08-19 00:12:05 +02:00
parent 4550eebc90
commit b938c41067

View File

@ -92,7 +92,7 @@ constexpr int writeOpenFlags =
bool writeStringToFile(string const& filename, string const& data) {
// Open temporary file.
string tempname = filename + '~';
int fd = open(tempname.c_str(), writeOpenFlags);
int fd = open(tempname.c_str(), writeOpenFlags, S_IRUSR | S_IWUSR);
if (fd < 0) {
return false;
}