]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
Added ebnum to daq_evtbuild shmem name. Sergey
authorhadaq <hadaq>
Fri, 16 Apr 2010 15:01:15 +0000 (15:01 +0000)
committerhadaq <hadaq>
Fri, 16 Apr 2010 15:01:15 +0000 (15:01 +0000)
ebctrl/ioc/ebctrlApp/src/writerunid.c

index 9ebf657b093b1eb0c34f17fba1d1a80bb0321d4b..35f8be8d17b008c1bb4749a40a577aba0d2c685d 100644 (file)
@@ -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, "<E> 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, "<E> 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("<E> writerunid.c: check: Worker_getStatistic cannot access runId!\n");
       else
        printf("<D> writerunid.c: check: Worker_getStatistic runId = %lu\n", runId_check);