aboutsummaryrefslogtreecommitdiff
path: root/tests/server/tftpd.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-09-26 11:21:22 +0000
committerYang Tse <yangsita@gmail.com>2008-09-26 11:21:22 +0000
commit57ee847ce7e07b2744f46be990f887d067c00d44 (patch)
tree679b754954f79afeaf82b28ee368d6620b4ba7b9 /tests/server/tftpd.c
parent985bd18904a2184bc5c43f75a1dcbbcc1dc7256f (diff)
Avoid the use of the '? :' operator inside the call to our
test-server logging function. It doesn't work on some systems.
Diffstat (limited to 'tests/server/tftpd.c')
-rw-r--r--tests/server/tftpd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index 2ef23f2ad..fc51b6eff 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -96,6 +96,11 @@
/* include memdebug.h last */
#include "memdebug.h"
+#ifdef ENABLE_IPV6
+static bool use_ipv6 = FALSE;
+#endif
+static const char *ipv_inuse = "IPv4";
+
struct testcase {
char *buffer; /* holds the file data to send to the client */
size_t bufsize; /* size of the data in buffer */
@@ -407,7 +412,6 @@ const char *serverlogfile = DEFAULT_LOGFILE;
#define REQUEST_DUMP "log/server.input"
-static char use_ipv6=FALSE;
int main(int argc, char **argv)
{
@@ -445,7 +449,8 @@ int main(int argc, char **argv)
}
else if(!strcmp("--ipv6", argv[arg])) {
#ifdef ENABLE_IPV6
- use_ipv6=TRUE;
+ ipv_inuse = "IPv6";
+ use_ipv6 = TRUE;
#endif
arg++;
}
@@ -515,8 +520,7 @@ int main(int argc, char **argv)
return 1;
}
- logmsg("Running IPv%d version on port UDP/%hu",
- (use_ipv6?6:4), port);
+ logmsg("Running %s version on port UDP/%d", ipv_inuse, (int)port);
do {
fromlen = sizeof(from);