From 4605ac9c663a2efa6474b9ce66e6c7d3f998dc8a Mon Sep 17 00:00:00 2001 From: Steve Dee Date: Wed, 15 Jan 2014 11:21:50 -0800 Subject: [PATCH] Fix ames port logic Hey, we have a -p flag. Neat. --- v/ames.c | 5 ++--- v/main.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/v/ames.c b/v/ames.c index 7a27b92db3..507aaebd39 100644 --- a/v/ames.c +++ b/v/ames.c @@ -281,7 +281,7 @@ u2_ames_io_init() srand(time(0)); // don't panic, only for fuzz testing - por_s = u2_Host.ops_u.por_s; + por_s = 0; if ( 0 != u2_Host.ops_u.imp_c ) { u2_noun imp = u2_ci_string(u2_Host.ops_u.imp_c); u2_noun num = u2_dc("slaw", 'p', imp); @@ -311,8 +311,7 @@ u2_ames_io_init() memset(&add_u, 0, sizeof(add_u)); add_u.sin_family = AF_INET; add_u.sin_addr.s_addr = htonl(INADDR_ANY); - //add_u.sin_port = htons(59009); - add_u.sin_port = htons(por_s); + add_u.sin_port = htons(u2_Host.ops_u.por_s); if ( uv_udp_bind(&sam_u->wax_u, add_u, 0) != 0 ) { uL(fprintf(uH, "ames: bind: %s\n", diff --git a/v/main.c b/v/main.c index 3ed476641b..39dbd9ae06 100644 --- a/v/main.c +++ b/v/main.c @@ -55,7 +55,7 @@ _main_getopt(c3_i argc, c3_c** argv) u2_Host.ops_u.vno = u2_no; u2_Host.ops_u.kno_w = DefaultKernel; u2_Host.ops_u.fuz_w = 0; - u2_Host.ops_u.por_s = 0; + u2_Host.ops_u.por_s = 59009; while ( (ch_i = getopt(argc, argv, "k:f:h:I:p:Lcdsagqv")) != -1 ) { switch ( ch_i ) {