aboutsummaryrefslogtreecommitdiff
path: root/toys/other/acpi.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-08-02 21:51:41 -0500
committerRob Landley <rob@landley.net>2015-08-02 21:51:41 -0500
commit7a3f53ba446ae2600763ee37b7f8dcc91de3ec5f (patch)
tree3c74019a20c6d23f18409ef026727b3195d3b6ee /toys/other/acpi.c
parent3aa1d18b727ded4415d8a5f34f90a0726213aa7f (diff)
downloadtoybox-7a3f53ba446ae2600763ee37b7f8dcc91de3ec5f.tar.gz
Mark command-local functions static.
Diffstat (limited to 'toys/other/acpi.c')
-rw-r--r--toys/other/acpi.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/toys/other/acpi.c b/toys/other/acpi.c
index 44fd03b1..363cfb99 100644
--- a/toys/other/acpi.c
+++ b/toys/other/acpi.c
@@ -25,10 +25,7 @@ config ACPI
#include "toys.h"
GLOBALS(
- int ac;
- int bat;
- int therm;
- int cool;
+ int ac, bat, therm, cool;
char *cpath;
)
@@ -44,7 +41,7 @@ int read_int_at(int dirfd, char *name)
return ret;
}
-int acpi_callback(struct dirtree *tree)
+static int acpi_callback(struct dirtree *tree)
{
int dfd, fd, len, on;
@@ -85,11 +82,11 @@ done:
return 0;
}
-int temp_callback(struct dirtree *tree)
+static int temp_callback(struct dirtree *tree)
{
int dfd, temp;
- if (tree->name[0]=='.') return 0;
+ if (*tree->name=='.') return 0;
if (!tree->parent || !tree->parent->parent)
return DIRTREE_RECURSE|DIRTREE_SYMFOLLOW;
errno = 0;
@@ -98,17 +95,17 @@ int temp_callback(struct dirtree *tree)
if ((0 < (temp = read_int_at(dfd, "temp"))) || !errno) {
//some tempertures are in milli-C, some in deci-C
//reputedly some are in deci-K, but I have not seen them
- if (((temp >= 1000) || (temp <= -1000)) && (temp%100 == 0))
- temp /= 100;
+ if (((temp >= 1000) || (temp <= -1000)) && (temp%100 == 0)) temp /= 100;
printf("Thermal %d: %d.%d degrees C\n", TT.therm++, temp/10, temp%10);
}
close(dfd);
}
free(TT.cpath);
+
return 0;
}
-int cool_callback(struct dirtree *tree)
+static int cool_callback(struct dirtree *tree)
{
int dfd=5, cur, max;