hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/scripts/diffconfig
....@@ -65,7 +65,7 @@
6565 else:
6666 print(" %s %s -> %s" % (config, value, new_value))
6767
68
-def main():
68
+def show_diff():
6969 global merge_style
7070
7171 # parse command line args
....@@ -129,4 +129,16 @@
129129 for config in new:
130130 print_config("+", config, None, b[config])
131131
132
-main()
132
+def main():
133
+ try:
134
+ show_diff()
135
+ except BrokenPipeError:
136
+ # Python flushes standard streams on exit; redirect remaining output
137
+ # to devnull to avoid another BrokenPipeError at shutdown
138
+ devnull = os.open(os.devnull, os.O_WRONLY)
139
+ os.dup2(devnull, sys.stdout.fileno())
140
+ sys.exit(1) # Python exits with error code 1 on EPIPE
141
+
142
+
143
+if __name__ == '__main__':
144
+ main()