Here's a diff that fixes the last three bugs listed on the powertop
project page:
# PowerTOP does not exit with non-zero exit code if handed an invalid option
# PowerTOP works with invalid options
# PowerTOP dumps usage message to stdout, not stderr
I also would like to remove the following piece of code from powertop.c
/*
* Quiet down the effects of any IO to xterms
*/
if (!key && ticktime >= 4.8) {
FD_ZERO(&rfds);
FD_SET(0, &rfds);
tv.tv_sec = 3;
tv.tv_usec = 0;
key = select(1, &rfds, NULL, NULL, &tv);
}
As the expected functionality is broken and is causing these two bugs:
# Time interval is not constant
# Multiple PowerTop instances experience time interval fluctuation
An alternative would be to calculate the '4.8' during execution, but I
don't know what to base it on.
What do you think ?
thanks
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bugs.diff
Type: text/x-patch
Size: 3270 bytes
Desc: not available
URL:
<http://mail.opensolaris.org/pipermail/tesla-dev/attachments/20080616/b814fb2a/attachment.bin>