From f69dd5a4ae141cfb367bf3f455c46d380e20bca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Wed, 21 Feb 2024 23:56:15 -0300 Subject: [PATCH] Fix editor freeze when editing code using rust-analyzer. --- src/thirdparty/subprocess/subprocess.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/thirdparty/subprocess/subprocess.h b/src/thirdparty/subprocess/subprocess.h index 497bf040e..0b68cd505 100644 --- a/src/thirdparty/subprocess/subprocess.h +++ b/src/thirdparty/subprocess/subprocess.h @@ -423,6 +423,8 @@ int subprocess_create_named_pipe_helper(void **rd, void **wr) { const unsigned long genericWrite = 0x40000000; const unsigned long openExisting = 3; const unsigned long fileAttributeNormal = 0x00000080; + const unsigned long fileNoBuffering = 0x20000000; + const unsigned long fileWriteThrough = 0x80000000; const void *const invalidHandleValue = SUBPROCESS_PTR_CAST(void *, ~(SUBPROCESS_CAST(subprocess_intptr_t, 0))); struct subprocess_security_attributes_s saAttr = {sizeof(saAttr), @@ -454,8 +456,8 @@ int subprocess_create_named_pipe_helper(void **rd, void **wr) { } *wr = CreateFileA(name, genericWrite, SUBPROCESS_NULL, - SUBPROCESS_PTR_CAST(LPSECURITY_ATTRIBUTES, &saAttr), - openExisting, fileAttributeNormal, SUBPROCESS_NULL); + SUBPROCESS_PTR_CAST(LPSECURITY_ATTRIBUTES, &saAttr), openExisting, + fileAttributeNormal | fileNoBuffering | fileWriteThrough, SUBPROCESS_NULL ); if (invalidHandleValue == *wr) { return -1; @@ -1333,8 +1335,6 @@ subprocess_write_stdin(struct subprocess_s *const process, char *const buffer, } } } - } else { - FlushFileBuffers(handle); } return SUBPROCESS_CAST(unsigned, bytes_write); #else