summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
authorGravatarGravatar cracyc <cracyc@users.noreply.github.com>2019-11-16 14:57:35 -0600
committerGravatarGravatar cracyc <cracyc@users.noreply.github.com>2019-11-16 14:59:02 -0600
commitb0ef759b80013332d8d19e954dd6330d76593602 (patch)
tree7ec1c0935d2eb0d9ad1779bcf1ae962eef7dcca0 /src/osd
parentdd86e8408c7ea56ff0999b6a880348f9891f2632 (diff)
winptty: don't create pipe unless requested (nw)
plugins/discord: disconnect if timed out (nw)
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/file/winptty.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/osd/modules/file/winptty.cpp b/src/osd/modules/file/winptty.cpp
index 943f1fbaa52..61867a869df 100644
--- a/src/osd/modules/file/winptty.cpp
+++ b/src/osd/modules/file/winptty.cpp
@@ -92,7 +92,8 @@ osd_file::error win_open_ptty(std::string const &path, std::uint32_t openflags,
if (INVALID_HANDLE_VALUE == pipe)
{
- pipe = CreateNamedPipe(t_name.c_str(), PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT, 1, 32, 32, 0, nullptr);
+ if (openflags & OPEN_FLAG_CREATE)
+ pipe = CreateNamedPipe(t_name.c_str(), PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT, 1, 32, 32, 0, nullptr);
if (INVALID_HANDLE_VALUE == pipe)
return osd_file::error::ACCESS_DENIED;
}