[rtems-libbsd commit] ttcp: Avoid namespace pollution

Sebastian Huber sebh at rtems.org
Wed May 11 13:17:09 UTC 2022


Module:    rtems-libbsd
Branch:    6-freebsd-12
Commit:    f62a9f15e3c900d98316a038544a0df52378d8cb
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=f62a9f15e3c900d98316a038544a0df52378d8cb

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed May 11 11:42:12 2022 +0200

ttcp: Avoid namespace pollution

The global err() function broke a lot of other commands.

---

 rtemsbsd/ttcp/ttcp.c | 41 ++++++++++++++++++-----------------------
 1 file 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;



More information about the vc mailing list