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

This commit is contained in:
Max Kellermann 2015-03-03 22:29:09 +01:00
parent 4dec12fcfc
commit 5b48d59769
2 changed files with 3 additions and 3 deletions

View File

@ -58,9 +58,9 @@
#endif
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();
}

View File

@ -90,7 +90,7 @@ public:
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);
#ifndef WIN32