summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-11 11:42:12 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-11 15:21:34 +0200
commitf62a9f15e3c900d98316a038544a0df52378d8cb (patch)
tree5f45914709014d23d999d51597941e2ee818668f
parentlibbsd: Add TFTP filesystem to test media01 (diff)
downloadrtems-libbsd-f62a9f15e3c900d98316a038544a0df52378d8cb.tar.bz2
ttcp: Avoid namespace pollution
The global err() function broke a lot of other commands.
-rw-r--r--rtemsbsd/ttcp/ttcp.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/rtemsbsd/ttcp/ttcp.c b/rtemsbsd/ttcp/ttcp.c
index d361fece..fe71844f 100644
--- a/rtemsbsd/ttcp/ttcp.c
+++ b/rtemsbsd/ttcp/ttcp.c
@@ -169,7 +169,7 @@ static void initialize_vars(void)
addr = NULL;
}
-char Usage[] = "\
+static const char Usage[] = "\
Usage: ttcp -t [-options] host [ < in ]\n\
ttcp -r [-options > out]\n\
Common options:\n\
@@ -193,28 +193,23 @@ Options specific to -r:\n\
-m ## delay for specified milliseconds between each write\n\
";
-char stats[128];
-double nbytes; /* bytes on net */
-unsigned long numCalls; /* # of I/O system calls */
-double cput, realt; /* user, real time (seconds) */
-
-void err();
-void mes();
-void pattern();
-void prep_timer();
-double read_timer();
-int Nread();
-int Nwrite();
-void delay();
-int mread();
-char *outfmt();
-
-void
-sigpipe()
-{
-}
-
-void millisleep(long msec)
+static char stats[128];
+static double nbytes; /* bytes on net */
+static unsigned long numCalls; /* # of I/O system calls */
+static double cput, realt; /* user, real time (seconds) */
+
+static void err();
+static void mes();
+static void pattern();
+static void prep_timer();
+static double read_timer();
+static int Nread();
+static int Nwrite();
+static void delay();
+static int mread();
+static char *outfmt();
+
+static void millisleep(long msec)
{
#if defined(ENABLE_NANOSLEEP_DELAY)
struct timespec req;