Commit 5b48d597 authored by Max Kellermann's avatar Max Kellermann

system/FileDescriptor: add "mode" parameter to Open()

parent 4dec12fc
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
#endif #endif
bool bool
FileDescriptor::Open(const char *pathname, int flags) FileDescriptor::Open(const char *pathname, int flags, mode_t mode)
{ {
fd = ::open(pathname, flags | O_NOCTTY | O_CLOEXEC); fd = ::open(pathname, flags | O_NOCTTY | O_CLOEXEC, mode);
return IsDefined(); return IsDefined();
} }
......
...@@ -90,7 +90,7 @@ public: ...@@ -90,7 +90,7 @@ public:
return FileDescriptor(-1); return FileDescriptor(-1);
} }
bool Open(const char *pathname, int flags); bool Open(const char *pathname, int flags, mode_t mode=0666);
bool OpenReadOnly(const char *pathname); bool OpenReadOnly(const char *pathname);
#ifndef WIN32 #ifndef WIN32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment