From 8c746b3a2bfb67addbfa4d3d4b7c0dbc2e8ba985 Mon Sep 17 00:00:00 2001 From: Bjørn Mork Date: Tue, 23 Jun 2015 14:17:10 +0200 Subject: ripe-atlas-fw: imported version 4680 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Mork --- eperd/eooqd.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'eperd/eooqd.c') diff --git a/eperd/eooqd.c b/eperd/eooqd.c index 8ce460f..04bfcd6 100644 --- a/eperd/eooqd.c +++ b/eperd/eooqd.c @@ -88,17 +88,19 @@ int eooqd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int eooqd_main(int argc, char *argv[]) { int r; - char *pid_file_name; + char *pid_file_name, *instance_id_str; + char *check; struct event *checkQueueEvent, *rePostEvent; struct timeval tv; struct rlimit limit; atlas_id= NULL; + instance_id_str= NULL; pid_file_name= NULL; queue_id= ""; - (void)getopt32(argv, "A:P:q:", &atlas_id, &pid_file_name, - &queue_id); + (void)getopt32(argv, "A:i:P:q:", &atlas_id, &instance_id_str, + &pid_file_name, &queue_id); if (argc != optind+1) { @@ -106,6 +108,18 @@ int eooqd_main(int argc, char *argv[]) return 1; } + instance_id= 0; + if (instance_id_str) + { + instance_id= strtoul(instance_id_str, &check, 0); + if (check[0] != '\0') + { + report("unable to parse instance id '%s'", + instance_id_str); + return 1; + } + } + if(pid_file_name) { write_pidfile(pid_file_name); -- cgit v1.2.3