hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/scripts/checkkconfigsymbols.py
....@@ -113,7 +113,7 @@
113113 return args
114114
115115
116
-def main():
116
+def print_undefined_symbols():
117117 """Main function of this module."""
118118 args = parse_options()
119119
....@@ -472,5 +472,16 @@
472472 return defined, references
473473
474474
475
+def main():
476
+ try:
477
+ print_undefined_symbols()
478
+ except BrokenPipeError:
479
+ # Python flushes standard streams on exit; redirect remaining output
480
+ # to devnull to avoid another BrokenPipeError at shutdown
481
+ devnull = os.open(os.devnull, os.O_WRONLY)
482
+ os.dup2(devnull, sys.stdout.fileno())
483
+ sys.exit(1) # Python exits with error code 1 on EPIPE
484
+
485
+
475486 if __name__ == "__main__":
476487 main()