Skip to content

Commit 3c3a385

Browse files
authored
Apply a wait for named pipe after verification (scp-fs2open#7275)
1 parent 8438af2 commit 3c3a385

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

code/scripting/lua.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ static int io_open_limited (lua_State *L) {
131131
auto file_type = GetFileType(handle);
132132
CloseHandle(handle);
133133
file_allowed = (file_type == FILE_TYPE_PIPE) || (file_type == FILE_TYPE_CHAR);
134+
if (file_type == FILE_TYPE_PIPE) {
135+
//For pipes only, we should make sure that the handler has actually closed before continuing.
136+
WaitNamedPipeA(filename, 30000);
137+
}
134138
}
135139
#else
136140
struct stat file_stat_buffer;

0 commit comments

Comments
 (0)