Skip to content

Commit

Permalink
system/FileDescriptor: move O_NOCTTY|O_CLOEXEC to Open()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Mar 3, 2015
1 parent 57ad3ac commit 4dec12f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/system/FileDescriptor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@
bool
FileDescriptor::Open(const char *pathname, int flags)
{
fd = ::open(pathname, flags);
fd = ::open(pathname, flags | O_NOCTTY | O_CLOEXEC);
return IsDefined();
}

bool
FileDescriptor::OpenReadOnly(const char *pathname)
{
return Open(pathname, O_RDONLY | O_NOCTTY | O_CLOEXEC);
return Open(pathname, O_RDONLY);
}

#ifndef WIN32

bool
FileDescriptor::OpenNonBlocking(const char *pathname)
{
return Open(pathname, O_RDWR | O_NOCTTY | O_CLOEXEC | O_NONBLOCK);
return Open(pathname, O_RDWR | O_NONBLOCK);
}

bool
Expand Down

0 comments on commit 4dec12f

Please sign in to comment.