Skip to contentSkip to conversation

clang-tools: Import os for broken pipe handling

PATCH In review Ting-Han Hou 2 participants 2 messages Oct 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clang-tools: Import os for broken pipe handling

The BrokenPipeError handler in run-clang-tools.py calls os.open() and os.dup2() without importing os. If this handler is reached, it raises NameError instead of redirecting stdout and exiting with status 1.

Import os so the handler can work as intended.

Fixes 87c7ee67deb7 ("scripts: handle BrokenPipeError for python scripts")
Assisted-by LLM

---
Changes in v2:
- Drop the regression test and adjust the commit message (Nathan)
- Use my full name in the Signed-off-by
- v1: https://lore.kernel.org/r/[email protected]/

Sorry for the mangled resend in the meantime; this one is sent with git send-email.

 scripts/clang-tools/run-clang-tools.py | 1 +
 1 file changed, 1 insertion(+)
scripts/clang-tools/run-clang-tools.py +1 -0
index e78be82..79d58b3 100755
@@ -12,6 +12,7 @@ compile_commands.json.
 import argparse
 import json
 import multiprocessing
+import os
 import subprocess
 import sys
 

base-commit: fe2ec83746e501645709761605c2464a44fd2929

Signature · 1 line
2.52.0.windows.1
#1 lore raw
Quoted 1 line · Ting-Han Hou

clang-tools: Import os for broken pipe handling

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-next-unstable

Thanks!

[1/1] clang-tools: Import os for broken pipe handling

      https://git.kernel.org/kbuild/c/d26ab84593e63

Please look out for regression or issue reports or other follow up comments, as they may result in the patch/series getting dropped or reverted. Patches applied to an "unstable" branch are accepted pending wider testing in -next and any post-commit review; they will generally be moved to the main branch in a week if no issues are found.

Best regards,

Signature · 2 lines
Cheers,
Nathan