Mercurial > hg > toybox
changeset 1570:d2eb3c88a724 draft
Whitespace/code style.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 22 Nov 2014 00:31:03 -0600 |
parents | da72fa267b7b |
children | e85e5f3b87c2 |
files | toys/other/acpi.c |
diffstat | 1 files changed, 5 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/other/acpi.c Fri Nov 21 21:49:05 2014 -0600 +++ b/toys/other/acpi.c Sat Nov 22 00:31:03 2014 -0600 @@ -111,10 +111,11 @@ int cool_callback(struct dirtree *tree) { int dfd=5, cur, max; + errno = 0; memset(toybuf, 0, sizeof(toybuf)); - if (tree->name[0]=='.') return 0; + if (*tree->name == '.') return 0; if (!tree->parent) return DIRTREE_RECURSE|DIRTREE_SYMFOLLOW; @@ -136,14 +137,11 @@ void acpi_main(void) { - if (toys.optflags & FLAG_V) - toys.optflags = FLAG_a|FLAG_b|FLAG_c|FLAG_t; + if (toys.optflags & FLAG_V) toys.optflags = FLAG_a|FLAG_b|FLAG_c|FLAG_t; if (!toys.optflags) toys.optflags = FLAG_b; if (toys.optflags & (FLAG_a|FLAG_b)) dirtree_read("/sys/class/power_supply", acpi_callback); - if (toys.optflags & FLAG_t) - dirtree_read("/sys/class", temp_callback); - if (toys.optflags & FLAG_c) - dirtree_read("/sys/class/thermal", cool_callback); + if (toys.optflags & FLAG_t) dirtree_read("/sys/class", temp_callback); + if (toys.optflags & FLAG_c) dirtree_read("/sys/class/thermal", cool_callback); }