Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH] scripts: run-clang-tools: import os for broken pipe handling
@ 2026-09-28 23:47 omer zalman
  2026-09-29 20:23 ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: omer zalman @ 2026-09-28 23:47 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: nsc, llvm, linux-kbuild, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

The BrokenPipeError handler calls os.open() and os.dup2(), but the
module never imports os. A broken output pipe therefore raises
NameError while handling the original error. Import os so the
handler can redirect stdout and exit as intended.

Signed-off-by: Omer Zalman <omerzalman42@gmail.com>

The exact git-format-patch file is attached because Gmail's web
composer removes tabs from inline diffs.

[-- Attachment #2: 05-run-clang-tools-broken-pipe.patch --]
[-- Type: application/octet-stream, Size: 1165 bytes --]

From df5af4db02aa9678b106f0274913fb0b18c0cce6 Mon Sep 17 00:00:00 2001
From: Omer Zalman <omerzalman42@gmail.com>
Date: Sun, 27 Sep 2026 08:41:10 -0400
Subject: [PATCH] scripts: run-clang-tools: import os for broken pipe handling
To: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nsc@kernel.org>, llvm@lists.linux.dev, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org

From: Omer Zalman <omerzalman42@gmail.com>

The BrokenPipeError handler calls os.open() and os.dup2(), but the
module never imports os. A broken output pipe therefore raises
NameError while handling the original error. Import os so the
handler can redirect stdout and exit as intended.

Signed-off-by: Omer Zalman <omerzalman42@gmail.com>
---
 scripts/clang-tools/run-clang-tools.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/clang-tools/run-clang-tools.py b/scripts/clang-tools/run-clang-tools.py
index e78be82..79d58b3 100644
--- a/scripts/clang-tools/run-clang-tools.py
+++ b/scripts/clang-tools/run-clang-tools.py
@@ -12,6 +12,7 @@ compile_commands.json.
 import argparse
 import json
 import multiprocessing
+import os
 import subprocess
 import sys
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-29 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-28 23:47 [PATCH] scripts: run-clang-tools: import os for broken pipe handling omer zalman
2026-09-29 20:23 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox