EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: msi exitStatus bug
From: Bruce Hill <[email protected]>
To: EPICS tech-talk <[email protected]>
Date: Fri, 10 May 2013 19:33:29 -0700
In working with msi lately, I've found some problems
with the -V flag.

According to msi.html, unexpanded macros should cause
msi to return exit status 2 if the -V flag is used.   That was
true in msi1.4, but not in 1.5 or 1.6.    A non-zero exit status
is needed to cause make to abort if msi is used with -V and
not all the macros are expanded.

Also, there's a race on exit because the error msg for each
unexpanded macro goes to errlogPrintf, and a call to errlogFlush
is needed before exit to make sure the msgs get out.

A patch file for msi1.6 that fixes these problems is attached.

------------------------------------------------------------------

On a related note, does anyone know why msi is distributed as
an extension instead of being included in base?

Since msi is used to build all our modules and ioc's, it isn't possible
to build them without defining where to find msi, either in your
environment or in our case, in a RELEASE_SITE file.

None of the other extensions are needed to build ioc's, so MSI is
the only macro other than EPICS_SITE_TOP that needs to be defined
in order to build.

The fix is easy.   Just copying the msi folder from extensions/src to base/src
and adding "DIRS += msi" to src/Makefile builds and installs it.
To automatically define MSI, just change the MSI def in
configure/CONFIG_BASE from:

ifndef MSI
MSI = msi
endif

to

ifndef MSI
MSI = $(TOOLS)/msi
endif

My recommendation would be to move msi from extensions
to base in the next release.

Regards,
- Bruce

--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA  94025

--- /reg/neh/home1/bhill/wa2/trunk/pcds/epics/base/current/src/msi/msi.c	2013-05-10 18:44:43.784445845 -0700
+++ msi.c	2013-05-10 18:33:12.266405279 -0700
@@ -25,7 +25,6 @@
 #include <dbDefs.h>
 #include <macLib.h>
 #include <ellLib.h>
-#include <errlog.h>
 
 #define MAX_BUFFER_SIZE 4096
 
@@ -127,7 +126,6 @@
         }
         substituteDestruct(substitutePvt);
     }
-    errlogFlush();
     inputDestruct(inputPvt);
     free((void *)templateName);
     free((void *)substitutionName);
@@ -236,12 +234,8 @@
 	    n = macExpandString(macPvt,input,buffer,MAX_BUFFER_SIZE-1);
 	    fputs(buffer,stdout);
 	    if (!unexpWarned && n<0) {
-	    	const char * pErrMsg = "Warning: Undefined macros present, use msi -V to list\n";
-		if ( opt_V ) {
-		    exitStatus = 2;
-		    pErrMsg = "Error: Undefined macros present\n";
-		}
-		fprintf( stderr, pErrMsg );
+		fprintf(stderr, "Warning: Undefined macros present%s\n",
+			opt_V ? "" : ", use  msi -V  to list");
 		unexpWarned++;
 	    }
 	}

Replies:
Re: msi exitStatus bug Andrew Johnson

Navigate by Date:
Prev: Re: mmio in epics base Bjorklund, Eric A
Next: Help needed at NSLS II - contract, permanent, sabbatical, or term Dalesio, Leo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: mmio in epics base Andrew Johnson
Next: Re: msi exitStatus bug Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·