aboutsummaryrefslogtreecommitdiff
path: root/toys/other
diff options
context:
space:
mode:
Diffstat (limited to 'toys/other')
-rw-r--r--toys/other/acpi.c17
-rw-r--r--toys/other/blkid.c2
-rw-r--r--toys/other/chcon.c2
-rw-r--r--toys/other/lspci.c2
-rw-r--r--toys/other/rev.c2
-rw-r--r--toys/other/tac.c2
-rw-r--r--toys/other/taskset.c2
-rw-r--r--toys/other/vmstat.c2
8 files changed, 14 insertions, 17 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;
diff --git a/toys/other/blkid.c b/toys/other/blkid.c
index 725f163d..c18cc9c0 100644
--- a/toys/other/blkid.c
+++ b/toys/other/blkid.c
@@ -57,7 +57,7 @@ static const struct fstype fstypes[] = {
};
/* TODO if no args use proc/partitions */
-void do_blkid(int fd, char *name)
+static void do_blkid(int fd, char *name)
{
int off, i, j;
char *type;
diff --git a/toys/other/chcon.c b/toys/other/chcon.c
index a2bbb66c..6dbdd13f 100644
--- a/toys/other/chcon.c
+++ b/toys/other/chcon.c
@@ -21,7 +21,7 @@ config CHCON
#define FOR_chcon
#include "toys.h"
-int do_chcon(struct dirtree *try)
+static int do_chcon(struct dirtree *try)
{
char *path, *con = *toys.optargs;
diff --git a/toys/other/lspci.c b/toys/other/lspci.c
index c9b22abf..077ce757 100644
--- a/toys/other/lspci.c
+++ b/toys/other/lspci.c
@@ -37,7 +37,7 @@ GLOBALS(
FILE *db;
)
-int do_lspci(struct dirtree *new)
+static int do_lspci(struct dirtree *new)
{
char *p = toybuf, *vendor = toybuf+9, *device = toybuf+18,
driver[256], *vbig = 0, *dbig = 0, **fields;
diff --git a/toys/other/rev.c b/toys/other/rev.c
index b5720a31..4cf7214f 100644
--- a/toys/other/rev.c
+++ b/toys/other/rev.c
@@ -15,7 +15,7 @@ config REV
#include "toys.h"
-void do_rev(int fd, char *name)
+static void do_rev(int fd, char *name)
{
char *c;
diff --git a/toys/other/tac.c b/toys/other/tac.c
index 538d1b0b..d5f72fd2 100644
--- a/toys/other/tac.c
+++ b/toys/other/tac.c
@@ -15,7 +15,7 @@ config TAC
#include "toys.h"
-void do_tac(int fd, char *name)
+static void do_tac(int fd, char *name)
{
struct arg_list *list = NULL;
char *c;
diff --git a/toys/other/taskset.c b/toys/other/taskset.c
index 28519231..4ade5f10 100644
--- a/toys/other/taskset.c
+++ b/toys/other/taskset.c
@@ -120,7 +120,7 @@ void taskset_main(void)
}
}
-int do_nproc(struct dirtree *new)
+static int do_nproc(struct dirtree *new)
{
if (!new->parent) return DIRTREE_RECURSE;
if (!strncmp(new->name, "cpu", 3) && isdigit(new->name[3])) TT.nproc++;
diff --git a/toys/other/vmstat.c b/toys/other/vmstat.c
index c11e46b1..9a38e452 100644
--- a/toys/other/vmstat.c
+++ b/toys/other/vmstat.c
@@ -39,7 +39,7 @@ struct vmstat_proc {
// All the elements of vmstat_proc are the same size, so we can populate it as
// a big array, then read the elements back out by name
-void get_vmstat_proc(struct vmstat_proc *vmstat_proc)
+static void get_vmstat_proc(struct vmstat_proc *vmstat_proc)
{
char *vmstuff[] = { "/proc/stat", "cpu ", 0, 0, 0, 0, 0, 0,
"intr ", "ctxt ", "procs_running ", "procs_blocked ", "/proc/meminfo",