From 82300c623d68443a95f9a1dced907009fb49f078 Mon Sep 17 00:00:00 2001
From: thorkill <thkr@hannover.ccc.de>
Date: Tue, 30 Jun 2015 22:49:11 +0200
Subject: [PATCH] Make sptps_speed and sptps_test compile

TODO: tests do not work
---
 src/sptps_speed.c | 20 ++++++++++----------
 src/sptps_test.c  | 10 +++++-----
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/sptps_speed.c b/src/sptps_speed.c
index bde3d697..9819279c 100644
--- a/src/sptps_speed.c
+++ b/src/sptps_speed.c
@@ -30,11 +30,11 @@
 
 // Symbols necessary to link with logger.o
 bool send_request(void *c, const char *msg, ...) { return false; }
-struct list_t *connection_list = NULL;
+static struct list_t *connection_list = NULL;
 bool send_meta(void *c, const char *msg , int len) { return false; }
-char *logfilename = NULL;
-bool do_detach = false;
-struct timeval now;
+static char *logfilename = NULL;
+static bool do_detach = false;
+static struct timeval now;
 
 static bool send_data(void *handle, uint8_t type, const void *data, size_t len) {
 	int fd = *(int *)handle;
@@ -59,11 +59,11 @@ static void receive_data(sptps_t *sptps) {
 	}
 }
 
-struct timespec start;
-struct timespec end;
-double elapsed;
-double rate;
-unsigned int count;
+static struct timespec start;
+static struct timespec end;
+static double elapsed;
+static double rate;
+static unsigned int count;
 
 static void clock_start() {
 	count = 0;
@@ -139,7 +139,7 @@ int main(int argc, char *argv[]) {
 		return 1;
 	}
 
-	struct pollfd pfd[2] = {{fd[0], POLLIN}, {fd[1], POLLIN}};
+	struct pollfd pfd[2] = {{fd[0], POLLIN, -1}, {fd[1], POLLIN, -1}};
 
 	fprintf(stderr, "SPTPS/TCP authenticate for %lg seconds: ", duration);
 	for(clock_start(); clock_countto(duration);) {
diff --git a/src/sptps_test.c b/src/sptps_test.c
index 9452ed1e..a0445603 100644
--- a/src/sptps_test.c
+++ b/src/sptps_test.c
@@ -32,11 +32,11 @@
 
 // Symbols necessary to link with logger.o
 bool send_request(void *c, const char *msg, ...) { return false; }
-struct list_t *connection_list = NULL;
+static struct list_t *connection_list = NULL;
 bool send_meta(void *c, const char *msg , int len) { return false; }
-char *logfilename = NULL;
-bool do_detach = false;
-struct timeval now;
+static char *logfilename = NULL;
+static bool do_detach = false;
+static struct timeval now;
 
 static bool verbose;
 static bool readonly;
@@ -75,7 +75,7 @@ static struct option const long_options[] = {
 	{NULL, 0, NULL, 0}
 };
 
-const char *program_name;
+static const char *program_name;
 
 static void usage() {
 	fprintf(stderr, "Usage: %s [options] my_ed25519_key_file his_ed25519_key_file [host] port\n\n", program_name);