From: hadaq Date: Mon, 16 Aug 2004 15:02:12 +0000 (+0000) Subject: Only operate on existing workers, somewhat sloppyly tested X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d62999ebf69243b6717ae8b2f7485804dbe5b3d3;p=daqdata.git Only operate on existing workers, somewhat sloppyly tested --- diff --git a/hadaq/agent.c b/hadaq/agent.c index 67a1fa0..62311aa 100644 --- a/hadaq/agent.c +++ b/hadaq/agent.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/agent.c,v 6.14 2003-08-27 13:09:03 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/agent.c,v 6.15 2004-08-16 15:02:12 hadaq Exp $"; #define _GNU_SOURCE #include @@ -71,11 +71,17 @@ int *rpcworker_start_1_svc(RpcWorker_startArgs * dummy, struct svc_req *x) char **rpcworker_status_1(int *id, CLIENT * cl) { static char *retVal; + char *worker; openlog("daq_agent", LOG_PID | LOG_PERROR, LOG_LOCAL0); setlogmask(LOG_UPTO(LOG_INFO)); - retVal = Worker_status(getWorker(*id)); + worker = getWorker(*id); + if (*worker != '\0') { + retVal = Worker_status(worker); + } else { + retVal = "{}"; + } closelog(); @@ -90,11 +96,15 @@ char **rpcworker_status_1_svc(int *dummy, struct svc_req *x) int *rpcworker_stop_1(int *id, CLIENT * cl) { static int retVal; + char *worker; openlog("daq_agent", LOG_PID | LOG_PERROR, LOG_LOCAL0); setlogmask(LOG_UPTO(LOG_INFO)); - Worker_stop(getWorker(*id), 15); + worker = getWorker(*id); + if (*worker != '\0') { + Worker_stop(worker, 15); + } closelog();