From: hadaq Date: Fri, 16 Apr 2010 15:01:15 +0000 (+0000) Subject: Added ebnum to daq_evtbuild shmem name. Sergey X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=7729b5274aa73c5019ff139773c85eaf1802091e;p=daqdata.git Added ebnum to daq_evtbuild shmem name. Sergey --- diff --git a/ebctrl/ioc/ebctrlApp/src/writerunid.c b/ebctrl/ioc/ebctrlApp/src/writerunid.c index 9ebf657..35f8be8 100644 --- a/ebctrl/ioc/ebctrlApp/src/writerunid.c +++ b/ebctrl/ioc/ebctrlApp/src/writerunid.c @@ -26,10 +26,15 @@ long writeRunId_proc( struct subRecord *psub ) static unsigned long runId = 0; runId = (unsigned long) psub->a; /* RUN Id */ - - if( Worker_setStatistic( "daq_evtbuild", "runId", &runId ) == -1 ) { + + char buf[_POSIX_PATH_MAX]; + int ebnum = getenv("EBNUM"); + + sprintf( buf, "%s%s", "daq_evtbuild", getenv("EBNUM") ); + + if( Worker_setStatistic( buf, "runId", &runId ) == -1 ) { if(writerunidDebug) { - fprintf( stderr, " writerunid.c: Worker_setStatistic failed for runId! Either shared memory daq_evtbuild was not created or statistic runId was not added by the event builder.\n"); + fprintf( stderr, " writerunid.c: Worker_setStatistic failed for runId! Either shared memory %s was not created or statistic runId was not added by the event builder.\n", buf); } } else @@ -38,7 +43,7 @@ long writeRunId_proc( struct subRecord *psub ) unsigned long runId_check; /* In the following we try to read back the RUN Id from the shared memory */ - if( Worker_getStatistic( "daq_evtbuild", "runId", &runId_check ) == -1 ) + if( Worker_getStatistic( buf, "runId", &runId_check ) == -1 ) printf(" writerunid.c: check: Worker_getStatistic cannot access runId!\n"); else printf(" writerunid.c: check: Worker_getStatistic runId = %lu\n", runId_check);