mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 07:46:15 +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:
parent
4550eebc90
commit
b938c41067
@ -92,7 +92,7 @@ constexpr int writeOpenFlags =
|
|||||||
bool writeStringToFile(string const& filename, string const& data) {
|
bool writeStringToFile(string const& filename, string const& data) {
|
||||||
// Open temporary file.
|
// Open temporary file.
|
||||||
string tempname = filename + '~';
|
string tempname = filename + '~';
|
||||||
int fd = open(tempname.c_str(), writeOpenFlags);
|
int fd = open(tempname.c_str(), writeOpenFlags, S_IRUSR | S_IWUSR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user