File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -142,11 +142,15 @@ fn diff(opt: DiffOpt) -> Result<(), Box<dyn Error + Send + Sync>> {
142
142
143
143
table. printstd ( ) ;
144
144
145
- _ = writeln ! (
145
+ let res = writeln ! (
146
146
std:: io:: stdout( ) ,
147
147
"Total cpu time: {:?}" ,
148
148
results. total_time
149
149
) ;
150
+ if res. is_err ( ) {
151
+ // there's something wrong with stdout - give up on writing more
152
+ std:: process:: exit ( 1 ) ;
153
+ }
150
154
151
155
let mut table = Table :: new ( ) ;
152
156
@@ -290,18 +294,26 @@ fn summarize(opt: SummarizeOpt) -> Result<(), Box<dyn Error + Send + Sync>> {
290
294
291
295
table. printstd ( ) ;
292
296
293
- _ = writeln ! (
297
+ let res = writeln ! (
294
298
std:: io:: stdout( ) ,
295
299
"Total cpu time: {:?}" ,
296
300
results. total_time
297
301
) ;
302
+ if res. is_err ( ) {
303
+ // there's something wrong with stdout - give up on writing more
304
+ std:: process:: exit ( 1 ) ;
305
+ }
298
306
299
307
if percent_above != 0.0 {
300
- _ = writeln ! (
308
+ let res = writeln ! (
301
309
std:: io:: stdout( ) ,
302
310
"Filtered results account for {:.3}% of total time." ,
303
311
percent_total_time
304
312
) ;
313
+ if res. is_err ( ) {
314
+ // there's something wrong with stdout - give up on writing more
315
+ std:: process:: exit ( 1 ) ;
316
+ }
305
317
}
306
318
307
319
let mut table = Table :: new ( ) ;
You can’t perform that action at this time.
0 commit comments