From 80343363a46d366055225d45a382976d6e72fd42 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 1 Jul 2015 11:30:02 -0500 Subject: [PATCH 1/4] configure: Include RULES_FILE_TYPE earlier From Benjamin Franksen: There is one remaining problem with the order of includes in the build rules for 3.14.12.5: configure/RULES_BUILD includes RULES_FILE_TYPE (which in turn includes the cfg/RULES* from modules in the RELEASE file) *after* including RULES.Db and RULES_JAVA. This makes it impossible to override (pattern) rules in one of these files. Instead, $(CONFIG)/RULES_FILE_TYPE should be included first. --- configure/RULES_BUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index c0e1ffbe7..1528c48d5 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -69,6 +69,8 @@ endif all: install +-include $(CONFIG)/RULES_FILE_TYPE + -include $(CONFIG)/RULES.Db -include $(CONFIG)/RULES_JAVA @@ -110,8 +112,6 @@ LIBTARGETS += $(LIBNAME) $(INSTALL_LIBS) \ $(INSTALL_LIBS): $(INSTALL_SHRLIBS) $(INSTALL_DLL_LINK_LIBS) $(INSTALL_LOADABLE_SHRLIBS) --include $(CONFIG)/RULES_FILE_TYPE - # Main targets install: buildInstall From 625172419e44361924a0ae92b4140b98f609f271 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 1 Jul 2015 12:00:42 -0500 Subject: [PATCH 2/4] libCom: Make epicsReadline behave the same on Darwin --- src/libCom/osi/os/default/epicsReadline.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libCom/osi/os/default/epicsReadline.c b/src/libCom/osi/os/default/epicsReadline.c index 1d7d9c1d5..7cdcfdafe 100644 --- a/src/libCom/osi/os/default/epicsReadline.c +++ b/src/libCom/osi/os/default/epicsReadline.c @@ -79,6 +79,7 @@ epicsReadlineEnd(void *context) #include #include +#include struct readlineContext { FILE *in; @@ -138,6 +139,14 @@ epicsReadline (const char *prompt, void *context) free (readlineContext->line); readlineContext->line = NULL; if (readlineContext->in == NULL) { + if (!isatty(fileno(stdout))) { + /* The libedit readline emulator on Darwin doesn't + * print the prompt when the terminal isn't a tty. + */ + fputs (prompt, stdout); + fflush (stdout); + rl_already_prompted = 1; + } rlState = rlBusy; line = readline (prompt); rlState = rlIdle; From 002bafdf07c7efe33d8dbb1eea45c5fc91de62e9 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 17 Jul 2015 18:06:58 -0500 Subject: [PATCH 3/4] Add testHarnessDone --- src/libCom/misc/epicsUnitTest.c | 4 ++-- src/libCom/misc/epicsUnitTest.h | 2 ++ src/libCom/test/epicsRunLibComTests.c | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libCom/misc/epicsUnitTest.c b/src/libCom/misc/epicsUnitTest.c index 9feb59195..730bde7a2 100644 --- a/src/libCom/misc/epicsUnitTest.c +++ b/src/libCom/misc/epicsUnitTest.c @@ -210,7 +210,7 @@ int testDone(void) { /* Our test harness, for RTEMS and vxWorks */ -static void harnessExit(void *dummy) { +void testHarnessExit(void *dummy) { epicsTimeStamp ended; int Faulty; @@ -247,7 +247,7 @@ static void harnessExit(void *dummy) { void testHarness(void) { epicsThreadOnce(&onceFlag, testOnce, NULL); - epicsAtExit(harnessExit, NULL); + epicsAtExit(testHarnessExit, NULL); Harness = 1; Programs = 0; Tests = 0; diff --git a/src/libCom/misc/epicsUnitTest.h b/src/libCom/misc/epicsUnitTest.h index c1f0a5939..47f5cf53a 100644 --- a/src/libCom/misc/epicsUnitTest.h +++ b/src/libCom/misc/epicsUnitTest.h @@ -40,9 +40,11 @@ epicsShareFunc int testDone(void); typedef int (*TESTFUNC)(void); epicsShareFunc void testHarness(void); +epicsShareFunc void testHarnessExit(void *dummy); epicsShareFunc void runTestFunc(const char *name, TESTFUNC func); #define runTest(func) runTestFunc(#func, func) +#define testHarnessDone() testHarnessExit(0) #ifdef __cplusplus } diff --git a/src/libCom/test/epicsRunLibComTests.c b/src/libCom/test/epicsRunLibComTests.c index e49c10166..aa62465ff 100644 --- a/src/libCom/test/epicsRunLibComTests.c +++ b/src/libCom/test/epicsRunLibComTests.c @@ -104,7 +104,12 @@ void epicsRunLibComTests(void) runTest(taskwdTest); /* - * Exit must come last as it never returns + * Report now in case epicsExitTest dies + */ + testHarnessDone(); + + /* + * epicsExitTest must come last as it never returns */ runTest(epicsExitTest); } From ae3d3904d99daed6d6812481a4429c8bb48c55db Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 17 Jul 2015 18:09:14 -0500 Subject: [PATCH 4/4] Fix minor locking issue in dbEvent.c --- src/db/dbEvent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/db/dbEvent.c b/src/db/dbEvent.c index 76f4f1a2c..3bcca8469 100644 --- a/src/db/dbEvent.c +++ b/src/db/dbEvent.c @@ -916,6 +916,7 @@ static void event_task (void *pParm) { struct event_user * const evUser = (struct event_user *) pParm; struct event_que * ev_que; + unsigned char pendexit; /* init hook */ if (evUser->init_func) { @@ -957,9 +958,10 @@ static void event_task (void *pParm) event_read (ev_que); epicsMutexMustLock ( evUser->lock ); } + pendexit = evUser->pendexit; epicsMutexUnlock ( evUser->lock ); - } while( ! evUser->pendexit ); + } while( ! pendexit ); epicsMutexDestroy(evUser->firstque.writelock);