Actions
Bug #4326
closedpowertop sometimes fails silently
Start date:
2013-11-14
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:
Description
# powertop OpenIndiana PowerTOP version 1.2 (C) 2009 Intel Corporation Collecting data for 5.00 second(s) # echo $? 1 #
Simple dtracing showed we are exiting here in pt_display_setup():
203 if (event_lines > 0) { 204 sw[SW_EVENTS] = subwin(stdscr, event_lines, win_cols, pos_y, 0); 205 } else { 206 (void) printf("\\n\\nPowerTOP cannot run in such a small " 207 "terminal window, please resize it.\\n\\n"); 208 exit(EXIT_FAILURE); 209 }
The problem is that pt_display_cleanup() needs to be called before printf() in a similar way as it is done in pt_display_get_size():
124static void 125pt_display_get_size(void) 126{ 127 getmaxyx(stdscr, win_rows, win_cols); 128 129 if (win_rows < PT_MIN_ROWS || win_cols < PT_MIN_COLS) { 130 pt_display_cleanup(); 131 (void) printf("\\n\\nPowerTOP cannot run in such a small " 132 "terminal window. Please resize it.\\n\\n"); 133 exit(EXIT_FAILURE); 134 } 135}
Updated by Robert Mustacchi about 10 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
- Tags deleted (
needs-triage)
Resolved in 9e21aac0c45b9a278df2cfb9d5674c279cc542d2.
Actions