ttcp: Avoid namespace pollution

The global err() function broke a lot of other commands.
This commit is contained in:
Sebastian Huber 2022-05-11 11:42:12 +02:00
parent d63f9cd9d9
commit f62a9f15e3

View File

@ -169,7 +169,7 @@ static void initialize_vars(void)
addr = NULL; addr = NULL;
} }
char Usage[] = "\ static const char Usage[] = "\
Usage: ttcp -t [-options] host [ < in ]\n\ Usage: ttcp -t [-options] host [ < in ]\n\
ttcp -r [-options > out]\n\ ttcp -r [-options > out]\n\
Common options:\n\ Common options:\n\
@ -193,28 +193,23 @@ Options specific to -r:\n\
-m ## delay for specified milliseconds between each write\n\ -m ## delay for specified milliseconds between each write\n\
"; ";
char stats[128]; static char stats[128];
double nbytes; /* bytes on net */ static double nbytes; /* bytes on net */
unsigned long numCalls; /* # of I/O system calls */ static unsigned long numCalls; /* # of I/O system calls */
double cput, realt; /* user, real time (seconds) */ static double cput, realt; /* user, real time (seconds) */
void err(); static void err();
void mes(); static void mes();
void pattern(); static void pattern();
void prep_timer(); static void prep_timer();
double read_timer(); static double read_timer();
int Nread(); static int Nread();
int Nwrite(); static int Nwrite();
void delay(); static void delay();
int mread(); static int mread();
char *outfmt(); static char *outfmt();
void static void millisleep(long msec)
sigpipe()
{
}
void millisleep(long msec)
{ {
#if defined(ENABLE_NANOSLEEP_DELAY) #if defined(ENABLE_NANOSLEEP_DELAY)
struct timespec req; struct timespec req;