From b71aff9637ef59f1130a4ee51669175d764948fc Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Wed, 31 Jan 2007 18:22:07 +0100 Subject: [PATCH] Make the port configurable. --- jam.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jam.c b/jam.c index 9f9a10d..0ebda02 100644 --- a/jam.c +++ b/jam.c @@ -6,8 +6,11 @@ #include #include +unsigned short port = 2007; + const static struct option longopts[] = { { "destination-file", required_argument, NULL, 'd' }, + { "port", required_argument, NULL, 'p' }, { NULL, 0, NULL, 0 } }; @@ -21,11 +24,14 @@ void parse_options(int argc, char **argv) int option_index = 0; for ( ;; ) { - int c = getopt_long(argc, argv, "d:", longopts, &option_index); + int c = getopt_long(argc, argv, "d:p:", longopts, &option_index); switch (c) { case 'd': read_destination_list(optarg); break; + case 'p': + port = atoi(optarg); + break; case -1: return; // end of argument list default: @@ -99,7 +105,7 @@ int main(int argc, char **argv) int server_sock; parse_options(argc, argv); - server_sock = get_server_socket(2007); + server_sock = get_server_socket(port); // FIXME: fire off sender workers here -- 2.39.2