aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2021-02-07 17:19:44 -0600
committerRob Landley <rob@landley.net>2021-02-07 17:19:44 -0600
commit664c417af5d16e217557468ba747a369e8e1ab6b (patch)
tree028aacc085207ef347fdaa9eb1ccf86d06257208 /toys/posix
parent9f7f62615f3963591af33fcc7582867f7063efd2 (diff)
downloadtoybox-664c417af5d16e217557468ba747a369e8e1ab6b.tar.gz
Add lots of "static" annotations, make a couple things use FLAG() macros, etc.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/chgrp.c2
-rw-r--r--toys/posix/logger.c3
-rw-r--r--toys/posix/patch.c2
-rw-r--r--toys/posix/ps.c2
-rw-r--r--toys/posix/test.c2
5 files changed, 6 insertions, 5 deletions
diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c
index 1e56d973..807ac824 100644
--- a/toys/posix/chgrp.c
+++ b/toys/posix/chgrp.c
@@ -100,7 +100,7 @@ void chgrp_main(void)
if (CFG_TOYBOX_FREE && ischown) free(own);
}
-void chown_main()
+void chown_main(void)
{
chgrp_main();
}
diff --git a/toys/posix/logger.c b/toys/posix/logger.c
index fae3fddb..906d64f4 100644
--- a/toys/posix/logger.c
+++ b/toys/posix/logger.c
@@ -30,7 +30,8 @@ GLOBALS(
// find str in names[], accepting unambiguous short matches
// returns offset into array of match, or -1 if no match
-int arrayfind(char *str, char *names[], int len)
+// TODO: move to lib?
+static int arrayfind(char *str, char *names[], int len)
{
int j, i, ll = 0, maybe = -1;
diff --git a/toys/posix/patch.c b/toys/posix/patch.c
index e0f13dd7..f0aad4ee 100644
--- a/toys/posix/patch.c
+++ b/toys/posix/patch.c
@@ -259,7 +259,7 @@ done:
}
// read a filename that has been quoted or escaped
-char *unquote_file(char *filename)
+static char *unquote_file(char *filename)
{
char *s = filename, *t;
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 7013dc57..304fe006 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1280,7 +1280,7 @@ static void default_ko(char *s, void *fields, char *err, struct arg_list *arg)
if (x) help_help();
}
-void common_setup(void)
+static void common_setup(void)
{
char buf[128];
int i;
diff --git a/toys/posix/test.c b/toys/posix/test.c
index d1ea1663..3fadf3ad 100644
--- a/toys/posix/test.c
+++ b/toys/posix/test.c
@@ -49,7 +49,7 @@ config TEST_GLUE
#include "toys.h"
// Consume 3, 2, or 1 argument test, returning result and *count used.
-int do_test(char **args, int *count)
+static int do_test(char **args, int *count)
{
char c, *s;
int i;