Commit Graph

121 Commits

Author SHA1 Message Date
Michael Davidsaver
f7fc564556 Fold antelope/flex and asHost into libCom
Build lexer and parser from libCom/Makefile.
Since libCom now includes asLib.c and asLib_lex.c we must build
antelope and flex without linking them to Com.  This works because
they only need epicsTempFile anyway.  However make doesn't like a
subdirectory with the same name as a target object, so the antelope
source directory is now called yacc.  The two main.c files were also
renamed to avoid other build problems.

Merge asHost into Com and remove mentions in CONFIG_BASE

Lots of noise since SRCS must be renamed to Com_SRCS
2011-02-25 15:39:44 -06:00
Andrew Johnson
588ea50bfb Split libCom/Makefile into individual subdirectories.
The new Makefile fragments in the subdirectories are incomplete and will
not work individually.  Build rules are placed in a separate RULES file.
This approach keeps the instructions for building each file local and
easier to find than in a large Makefile in the parent directory.
2011-02-25 00:49:03 -06:00
Michael Davidsaver
a80bd1a630 libCom: Avoid race in errlog shutdown.
A rare race during shutdown.  The contenders are the log thread
coming out of its loop and calling errlogCleanup(), and the
exitHandler signaling waitForWork.

This solution is to move cleanup completely into exitHandler,
which already waits for the log thread to exit.
2011-07-08 11:18:00 -05:00
Michael Davidsaver
2949f6650e errlog: Flush messages before exit
When an exit is requested process all messages before exiting.

The atExit flag is set, so no new messages can be added to the buffer.
2011-04-12 18:12:52 -05:00
Andrew Johnson
f4528ff5e1 libCom: Fix msgbufGetNode() in errlog.c
Systems that generate large numbers of errlog messages or have a slow
message listener could overwrite older messages in the message buffer
after the buffer wraps.  This also corrects and annotates the test
code to describe what's being checked.
2011-03-01 15:03:33 -06:00
Michael Davidsaver
6170dc9406 libCom: Fix errlogPrintf() assert fail at shutdown
If errlogPrintf() gets called during shutdown, it can cause a
recursive assert failure.

Fixes lp:693534
2011-01-07 10:24:31 -06:00
Andrew Johnson
9a831f9dc5 libCom: Simplify libCom/Makefile by splitting into parts
Each SRC_DIR gets its own Makefile fragment, and where it needs
private build rules a RULES files.

If this pattern gets used elsewhere we could automate the include
lines (search $(SRC_DIRS) for Makefiles and RULES files?).
2010-12-10 15:23:42 -06:00
Andrew Johnson
c503a03f37 libCom/errlog: Clean up possible problem at shutdown.
Don't use epicsMutexMustLock() in msgbufGetFree().
When we're shutting down, the pvtData.msgQueueLock gets destroyed.
This makes msgbufGetFree() return NULL if the lock is dead.
The epicsMutexMustLock() routine asserts(), which recurses...
2010-11-15 15:46:40 -06:00
Andrew Johnson
fbda9f3280 RCS keyword updates for Bazaar
Replaced $Id$ and $Header$ keywords with $Revision-Id$
Deleted $Log$ keywords and any log messages
2010-10-05 14:27:37 -05:00
Andrew Johnson
9678b69c1e libCom/errlog: Rewrote msgbufGetNode() to use buffer better.
Michael Davidsaver pointed out that the original algorithm used is
dumb, it can't reuse empty space at the beginning until all messages
have been drained.  This new version can, and is more efficient.
2010-09-23 15:41:55 -05:00
Michael Davidsaver
aee66600ef errPrintf() newline fix.
errPrintf() was adding a newline when writing to the err log buffer,
but not when printing to the screen.  This results in the error
message running together with the next line.  Added a newline to the
stderr output.
2010-09-01 14:56:51 -05:00
Andrew Johnson
6ece3235c9 Added libCom/test code for epicsThreadOnce() implementations.
Also fixed subsystems that were not using epicsThreadOnce correctly.
2010-04-26 15:48:42 -05:00
Andrew Johnson
3d717f4476 (M. Davidsaver): errnumlist was never initialized.
Removed long-deprecated errSymFind routine.
2009-07-09 20:11:02 +00:00
Andrew Johnson
4e0ab97038 (M. Davidsaver): static keyword is part of C89,
remove all uses and internal definitions of LOCAL macro
2009-07-09 16:37:24 +00:00
Andrew Johnson
d6fcbe14ab Cleaned up dbDefs.h and errMdef.h
Added various #include lines needed in other sources.
2009-07-09 15:27:43 +00:00
Andrew Johnson
d84d198733 Initialize the errSym table as part of errlogInit rather than doing it
later in an error path, when we might have already run out of memory!
2009-06-19 18:24:22 +00:00
Andrew Johnson
03c82fa651 More ANSI C conversion 2009-04-27 18:31:50 +00:00
Ralph Lange
7fccc59fe9 ANSIfication of stuff (mostly missing argument types in declarations) 2009-04-03 17:46:26 +00:00
Andrew Johnson
f1a0584273 Fix gcc warnings. 2009-02-03 06:05:51 +00:00
Andrew Johnson
ffe38fffb8 Don't forget to flush! 2009-01-28 21:16:39 +00:00
Andrew Johnson
c85052de6c Fix errlogPrint and errlogVprintf so the latter outputs to the console. 2009-01-28 21:05:34 +00:00
Andrew Johnson
12e4ad3c5a Cleanup. Handle re-initialization during shutdown gracefully. 2008-12-10 21:43:36 +00:00
Andrew Johnson
9cd14f0cc4 Send errlog output to stderr rather than stdout, from J Lewis Muir. 2008-07-10 18:04:10 +00:00
Andrew Johnson
86bea94113 Change #! line, perl is rarely in /usr/local nowadays. 2008-05-28 20:55:40 +00:00
Andrew Johnson
d7d3bf4a13 Added an errlogInit2() routine to allow an enlarged maximum message size to be
specified at initialization time.
2006-11-08 22:14:21 +00:00
Jeff Hill
319e001d1b no longer an owner of this code 2005-03-22 21:49:34 +00:00
Marty Kraimer
3fe2c5f343 errlog crashes if called from interruot context 2005-03-17 20:41:00 +00:00
Marty Kraimer
b916c750d7 do not call vfprintf twice in same routine. powerPC crashes 2005-02-15 20:02:01 +00:00
Marty Kraimer
262901c567 call epicsAtExit from errlogThread 2004-09-16 11:25:09 +00:00
Marty Kraimer
63f139adc5 epicsExit and epicsStdioRedirect 2004-08-27 16:04:26 +00:00
Marty Kraimer
83adcfbaea implement atexit to cleanup 2004-08-03 18:17:56 +00:00
Marty Kraimer
12b20f2398 More changes for OkToBlock 2004-07-16 11:33:53 +00:00
Marty Kraimer
4324145435 dont printf unless pvtData.toConsole 2004-07-15 14:04:29 +00:00
Marty Kraimer
1b20ea0e6a wrong logic on msgbufGetFree(isOkToBlock) 2004-07-14 13:22:28 +00:00
Marty Kraimer
f54d1ca30a epicsThreadIsOkToBlock epicsThreadSetOkToBlock only for calling thread 2004-07-13 13:35:35 +00:00
Marty Kraimer
f2fc8f8838 ShellContext=>OkToBlock 2004-07-09 17:53:54 +00:00
Marty Kraimer
e9f54b70d9 if shellContext call printf from initial thread 2004-07-09 16:06:51 +00:00
W. Eric Norum
dfccee739f Clean up 'truncated' message.
Ensure that truncated errrlogMessage output is reported as such.
2003-09-17 19:35:45 +00:00
Jeff Hill
35d07ffbda changed the name of cxxCompilerDependencies.h to compilerDependencies.h 2003-09-17 19:25:31 +00:00
W. Eric Norum
d158974870 Use epicsVsnprintf to eliminate possibility of buffer overflows. 2003-09-17 18:51:44 +00:00
W. Eric Norum
2e922d7195 Move format-string checking conditional to cxxCompilerDependencies. 2003-09-17 14:43:26 +00:00
W. Eric Norum
22e21f268b Add gcc format-string checking. 2003-09-16 18:06:49 +00:00
Marty Kraimer
00c9d22936 suppress extra console message from logMsg 2003-08-06 18:17:30 +00:00
Marty Kraimer
26fac718bf set BUFFER_EXTRA_BYTES = MAX_MESSAGE_SIZE 2003-04-04 16:29:29 +00:00
Jeff Hill
d7c25d1554 removed epicsShareAPIV 2003-03-27 21:02:27 +00:00
Marty Kraimer
652d3a41d8 use epicsVsnprintf instead of vsprint; allow more extra bytes because vxWorks subject to buffer overflow 2003-03-25 17:09:16 +00:00
Jeff Hill
950d2c0b9d 1) depricated errSymFind function because errSymLookup below provides a
better interface
2) added errSymLookup function with these improvements
o  receive a buffer length from user and therefore never overwrite the users buffer
o return void and always copy a string into the users buffer. If the error code cant
be found then copy in a message with the error code's raw numbers in it.
3) removed prototypes for nonexistent fuinctions from header file
2002-08-29 16:45:16 +00:00
Janet B. Anderson
93b0bf478d Updated license comments. 2002-07-12 21:35:43 +00:00
Marty Kraimer
d98e84cd6f errlogFlush must call errlogInit 2002-07-12 11:15:58 +00:00
Marty Kraimer
02c8f06c7f call errlogFlush before terminating 2002-07-09 18:58:54 +00:00