[mutter] ci: Avoid deadlock while reading uncrustify output



commit 6960b9b45a5f272673ba3e69b48c4be26f6e146a
Author: Robert Mader <robert mader posteo de>
Date:   Mon Aug 23 17:36:30 2021 +0200

    ci: Avoid deadlock while reading uncrustify output
    
    The docu for `Popen.wait()` says:
    > This will deadlock when using stdout=PIPE and/or stderr=PIPE and
    > the child process generates enough output to a pipe such that it
    > blocks waiting for the OS pipe buffer to accept more data.
    
    Fixes 3caa5fea3c66cd860e333524ae1a62a195aeda1a
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1971>

 check-style.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/check-style.py b/check-style.py
index ac96c5cae8..9c31905766 100755
--- a/check-style.py
+++ b/check-style.py
@@ -76,11 +76,11 @@ def reformat_chunks(chunks, rewrite):
 
         # uncrustify chunk
         proc = subprocess.Popen(["uncrustify", "-c", uncrustify_cfg, "-f", tmp.name], stdout=subprocess.PIPE)
+        reindented = proc.stdout.readlines()
         proc.wait()
         if proc.returncode != 0:
             continue
 
-        reindented = proc.stdout.readlines()
         tmp.close()
 
         # Remove INDENT-ON/OFF comments


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]