From 746c7397694c154b3adb110d4e67f12a78badb38 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver
Date: Sat, 11 Jan 2014 10:58:39 -0500
Subject: [PATCH 01/70] add epicsStrnLen()
Base currently requires only POSIX 2001 while
strnlen() is part of POSIX 2008.
---
src/libCom/misc/epicsString.c | 12 ++++++++++++
src/libCom/misc/epicsString.h | 1 +
src/libCom/test/epicsStringTest.c | 7 ++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/libCom/misc/epicsString.c b/src/libCom/misc/epicsString.c
index 11099d037..5da579cfa 100644
--- a/src/libCom/misc/epicsString.c
+++ b/src/libCom/misc/epicsString.c
@@ -239,6 +239,18 @@ int epicsStrPrintEscaped(FILE *fp, const char *s, size_t len)
return nout;
}
+/* Until Base requires POSIX 2008 we must provide our own implementation */
+size_t epicsStrnLen(const char *s, size_t maxlen)
+{
+ size_t i;
+
+ for (i=0; i
Date: Sat, 11 Jan 2014 10:59:57 -0500
Subject: [PATCH 02/70] rsrv: avoid strlen() on possible unterminated strings
Detect these w/o risk of SIGSEGV
---
src/rsrv/camessage.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c
index 800d90810..93c624298 100644
--- a/src/rsrv/camessage.c
+++ b/src/rsrv/camessage.c
@@ -21,6 +21,7 @@
#include "osiSock.h"
#include "osiPoolStatus.h"
+#include "epicsString.h"
#include "epicsEvent.h"
#include "epicsStdio.h"
#include "epicsThread.h"
@@ -708,7 +709,7 @@ static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *p
*/
if ( mp->m_dataType == DBR_STRING && mp->m_count == 1 ) {
char * pStr = (char *) pPayload;
- size_t strcnt = strlen ( pStr );
+ size_t strcnt = epicsStrnLen( pStr, payloadSize );
if ( strcnt < payloadSize ) {
payloadSize = ( ca_uint32_t ) ( strcnt + 1u );
}
@@ -843,7 +844,7 @@ static int write_action ( caHdrLargeArray *mp,
static int host_name_action ( caHdrLargeArray *mp, void *pPayload,
struct client *client )
{
- unsigned size;
+ ca_uint32_t size;
char *pName;
char *pMalloc;
int chanCount;
@@ -867,8 +868,8 @@ static int host_name_action ( caHdrLargeArray *mp, void *pPayload,
}
pName = (char *) pPayload;
- size = strlen(pName)+1;
- if (size > 512) {
+ size = epicsStrnLen(pName, mp->m_postsize)+1;
+ if (size > 512 || size > mp->m_postsize) {
log_header ( "bad (very long) host name",
client, mp, pPayload, 0 );
SEND_LOCK(client);
@@ -922,7 +923,7 @@ static int host_name_action ( caHdrLargeArray *mp, void *pPayload,
static int client_name_action ( caHdrLargeArray *mp, void *pPayload,
struct client *client )
{
- unsigned size;
+ ca_uint32_t size;
char *pName;
char *pMalloc;
int chanCount;
@@ -946,8 +947,8 @@ static int client_name_action ( caHdrLargeArray *mp, void *pPayload,
}
pName = (char *) pPayload;
- size = strlen(pName)+1;
- if (size > 512) {
+ size = epicsStrnLen(pName, mp->m_postsize)+1;
+ if (size > 512 || size > mp->m_postsize) {
log_header ("a very long user name was specified",
client, mp, pPayload, 0);
SEND_LOCK(client);
From 56d5a5935625074632ee1e9c1b9a6f18a4e06294 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver
Date: Tue, 26 Apr 2016 13:56:57 -0400
Subject: [PATCH 03/70] dbScan: optimize addToList
Insert from back to maintain ~same order.
Avoid iterating entire list each time
in the common case where all PHAS==0
---
src/ioc/db/dbScan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ioc/db/dbScan.c b/src/ioc/db/dbScan.c
index 0e2d09326..bab430188 100644
--- a/src/ioc/db/dbScan.c
+++ b/src/ioc/db/dbScan.c
@@ -940,9 +940,9 @@ static void addToList(struct dbCommon *precord, scan_list *psl)
pse->precord = precord;
}
pse->pscan_list = psl;
- ptemp = (scan_element *)ellFirst(&psl->list);
+ ptemp = (scan_element *)ellLast(&psl->list);
while (ptemp) {
- if (ptemp->precord->phas > precord->phas) {
+ if (ptemp->precord->phas <= precord->phas) {
ellInsert(&psl->list, ellPrevious(&ptemp->node), &pse->node);
break;
}
From 40d110fd7d7f36868ed510487ec40046efe9c466 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver
Date: Tue, 26 Apr 2016 13:56:57 -0400
Subject: [PATCH 04/70] ellSort
---
src/libCom/ellLib/ellLib.h | 2 +
src/libCom/ellLib/ellSort.c | 80 +++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+)
create mode 100644 src/libCom/ellLib/ellSort.c
diff --git a/src/libCom/ellLib/ellLib.h b/src/libCom/ellLib/ellLib.h
index f99859f3d..300a2df3f 100644
--- a/src/libCom/ellLib/ellLib.h
+++ b/src/libCom/ellLib/ellLib.h
@@ -56,6 +56,8 @@ epicsShareFunc void ellInsert (ELLLIST *plist, ELLNODE *pPrev, ELLNODE *pNode);
epicsShareFunc ELLNODE * ellNth (ELLLIST *pList, int nodeNum);
epicsShareFunc ELLNODE * ellNStep (ELLNODE *pNode, int nStep);
epicsShareFunc int ellFind (ELLLIST *pList, ELLNODE *pNode);
+typedef int (*pListCmp)(ELLNODE* A, ELLNODE* B);
+epicsShareFunc void ellSortStable(ELLLIST *pList, pListCmp);
epicsShareFunc void ellFree2 (ELLLIST *pList, FREEFUNC freeFunc);
epicsShareFunc void ellVerify (ELLLIST *pList);
diff --git a/src/libCom/ellLib/ellSort.c b/src/libCom/ellLib/ellSort.c
new file mode 100644
index 000000000..89f3f3819
--- /dev/null
+++ b/src/libCom/ellLib/ellSort.c
@@ -0,0 +1,80 @@
+/*
+ * Use of mergesort algorithm based on analysis by
+ * http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
+ */
+#include
+
+#define epicsExportSharedSymbols
+#include "epicsAssert.h"
+#include "ellLib.h"
+
+static void ellMoveN(ELLLIST* pTo, ELLLIST* pFrom, int count )
+{
+ for(;count && ellCount(pFrom); count--) {
+ ELLNODE *node = ellGet(pFrom);
+ ellAdd(pTo, node);
+ }
+}
+
+/* Stable (MergeSort) to given list.
+ * The comparison function cmp(A,B) is expected
+ * to return -1 for AB.
+ */
+void ellSortStable(ELLLIST *pList, pListCmp cmp)
+{
+ ELLLIST INP, P, Q;
+ size_t insize = 1; /* initial sub-list size */
+ if(ellCount(pList)<=1)
+ return;
+
+ ellInit(&INP);
+ ellInit(&P);
+ ellInit(&Q);
+
+ /* Process is to iteratively sort
+ * a sequence of sub-lists of size 'insize'
+ */
+
+ while(insize < ellCount(pList)) {
+
+ assert(ellCount(&INP)==0);
+
+ /* shift previous results to inputs */
+ ellConcat(&INP, pList);
+
+ assert(ellCount(pList)==0);
+
+ while(ellCount(&INP))
+ {
+ ELLNODE *p, *q;
+
+ assert(ellCount(&P)==0);
+ assert(ellCount(&Q)==0);
+
+ /* Pull out the next pair of sub-lists */
+ ellMoveN(&Q, &INP, insize);
+ ellMoveN(&P, &INP, insize);
+
+ /* merge these sub-lists */
+ while((p=ellFirst(&P)) && (q=ellFirst(&Q)))
+ {
+ if((*cmp)(p,q) < 0) {
+ ellAdd(pList, ellGet(&P));
+ } else {
+ ellAdd(pList, ellGet(&Q));
+ }
+ }
+
+ /* concatinate any remaining to result */
+ if(ellFirst(&P))
+ ellConcat(pList, &P);
+ else if(ellFirst(&Q))
+ ellConcat(pList, &Q);
+
+ assert(!ellFirst(&P) && !ellFirst(&Q));
+ }
+
+ insize *= 2;
+ }
+
+}
From 70fc52bca04d878996d9efea89df6aa65d942565 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver
Date: Tue, 26 Apr 2016 13:57:22 -0400
Subject: [PATCH 05/70] dbCreateRecord use ellSortStable()
sort records once per dbLoadCOM()
---
src/ioc/dbStatic/dbLexRoutines.c | 20 +++++++++++++++++++-
src/ioc/dbStatic/dbStaticLib.c | 12 +-----------
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/src/ioc/dbStatic/dbLexRoutines.c b/src/ioc/dbStatic/dbLexRoutines.c
index a2ebe6453..b9a1923d4 100644
--- a/src/ioc/dbStatic/dbLexRoutines.c
+++ b/src/ioc/dbStatic/dbLexRoutines.c
@@ -194,7 +194,16 @@ static void freeInputFileList(void)
free((void *)pinputFileNow);
}
}
-
+
+static
+int cmp_dbRecordNode(const ELLNODE *lhs, const ELLNODE *rhs)
+{
+ dbRecordNode *LHS = (dbRecordNode*)lhs,
+ *RHS = (dbRecordNode*)rhs;
+
+ return strcmp(LHS->recordname, RHS->recordname);
+}
+
static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
const char *path,const char *substitutions)
{
@@ -289,6 +298,15 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
dbFinishEntry(pdbEntry);
}
cleanup:
+ {
+ ELLNODE *cur;
+ for(cur = ellFirst(&pdbbase->recordTypeList); cur; cur=ellNext(cur))
+ {
+ dbRecordType *rtype = CONTAINER(cur, dbRecordType, node);
+
+ ellSortStable(&rtype->recList, &cmp_dbRecordNode);
+ }
+ }
if(macHandle) macDeleteHandle(macHandle);
macHandle = NULL;
if(mac_input_buffer) free((void *)mac_input_buffer);
diff --git a/src/ioc/dbStatic/dbStaticLib.c b/src/ioc/dbStatic/dbStaticLib.c
index 715612165..6cbefe61c 100644
--- a/src/ioc/dbStatic/dbStaticLib.c
+++ b/src/ioc/dbStatic/dbStaticLib.c
@@ -1426,17 +1426,7 @@ long dbCreateRecord(DBENTRY *pdbentry,const char *precordName)
pNewRecNode->recordname = dbRecordName(pdbentry);
ellInit(&pNewRecNode->infoList);
/* install record node in list in sorted postion */
- status = dbFirstRecord(pdbentry);
- while(status==0) {
- if(strcmp(precordName,dbGetRecordName(pdbentry)) < 0) break;
- status = dbNextRecord(pdbentry);
- }
- if(status==0) {
- precnode = pdbentry->precnode;
- ellInsert(preclist,ellPrevious(&precnode->node),&pNewRecNode->node);
- } else {
- ellAdd(preclist,&pNewRecNode->node);
- }
+ ellAdd(preclist, &pNewRecNode->node);
pdbentry->precnode = pNewRecNode;
ppvd = dbPvdAdd(pdbentry->pdbbase,precordType,pNewRecNode);
if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);}
From b035bd9963571c0d5fb251061851875134cb11a8 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver
Date: Tue, 26 Apr 2016 13:57:22 -0400
Subject: [PATCH 06/70] test ellSortStable
---
src/libCom/ellLib/Makefile | 1 +
src/libCom/test/epicsEllTest.c | 76 ++++++++++++++++++++++++++++++++--
2 files changed, 74 insertions(+), 3 deletions(-)
diff --git a/src/libCom/ellLib/Makefile b/src/libCom/ellLib/Makefile
index b325a453e..9a5cb3e67 100644
--- a/src/libCom/ellLib/Makefile
+++ b/src/libCom/ellLib/Makefile
@@ -10,3 +10,4 @@
SRC_DIRS += $(LIBCOM)/ellLib
INC += ellLib.h
Com_SRCS += ellLib.c
+Com_SRCS += ellSort.c
diff --git a/src/libCom/test/epicsEllTest.c b/src/libCom/test/epicsEllTest.c
index b608d1cc3..59a23df0a 100644
--- a/src/libCom/test/epicsEllTest.c
+++ b/src/libCom/test/epicsEllTest.c
@@ -11,6 +11,7 @@
#include
#include "ellLib.h"
+#include "dbDefs.h"
#include "epicsUnitTest.h"
#include "testMain.h"
@@ -20,15 +21,13 @@ struct myItem {
int num;
};
-MAIN(epicsEllTest)
+static void testList(void)
{
ELLLIST list1;
ELLLIST list2 = ELLLIST_INIT;
int i1 = 1;
struct myItem *pitem, *pfirst, *pick;
- testPlan(70);
-
list1.count = 27;
list1.node.next = (ELLNODE *) 0x01010101;
list1.node.previous = (ELLNODE *) 0x10101010;
@@ -192,6 +191,77 @@ MAIN(epicsEllTest)
ellFree2(&list1, free);
testOk1(ellCount(&list1) == 0);
+}
+
+typedef struct { int A, B; } input_t;
+
+static int myItemCmp(ELLNODE *a, ELLNODE *b)
+{
+ struct myItem *A = CONTAINER(a, struct myItem, node),
+ *B = CONTAINER(b, struct myItem, node);
+
+ if (A->num < B->num) return -1;
+ else if(A->num > B->num) return 1;
+ else if(A->list < B->list) return -1;
+ else if(A->list > B->list) return 1;
+ else return 0;
+}
+
+static const input_t input[] = {
+ {-4, 0},
+ {-5, 0},
+ {0,0},
+ {50,0},
+ {0,1},
+ {5,0},
+ {5,1}
+};
+
+static
+void testSort(const input_t *inp, size_t ninp)
+{
+ unsigned i;
+ ELLLIST list = ELLLIST_INIT;
+ struct myItem *alloc = calloc(ninp, sizeof(*alloc));
+
+ if(!alloc) testAbort("testSort allocation fails");
+
+ for(i=0; inum = inp[i].A;
+ it->list= inp[i].B;
+
+ ellAdd(&list, &it->node);
+ }
+
+ ellSortStable(&list, &myItemCmp);
+
+ testOk(ellCount(&list)==ninp, "output length %u == %u", (unsigned)ellCount(&list), (unsigned)ninp);
+ if(ellCount(&list)==0) {
+ testSkip(ninp-1, "all items lost");
+ }
+
+ {
+ struct myItem *prev = CONTAINER(ellFirst(&list), struct myItem, node),
+ *next;
+
+ for(next = CONTAINER(ellNext(&prev->node), struct myItem, node);
+ next;
+ prev = next, next = CONTAINER(ellNext(&next->node), struct myItem, node))
+ {
+ int cond = (prev->numnum) || (prev->num==next->num && prev->listlist);
+ testOk(cond, "%d:%d < %d:%d", prev->num, prev->list, next->num, next->list);
+ }
+ }
+}
+
+MAIN(epicsEllTest)
+{
+ testPlan(77);
+
+ testList();
+ testSort(input, NELEMENTS(input));
return testDone();
}
From 77d6609bbd46303b79a1bb1b58dfae63f6428bc7 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver
Date: Tue, 26 Apr 2016 20:19:19 -0400
Subject: [PATCH 07/70] fixup comments
---
src/ioc/dbStatic/dbStaticLib.c | 1 -
src/libCom/ellLib/ellSort.c | 8 ++++++++
src/libCom/test/epicsEllTest.c | 1 +
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/ioc/dbStatic/dbStaticLib.c b/src/ioc/dbStatic/dbStaticLib.c
index 6cbefe61c..166979655 100644
--- a/src/ioc/dbStatic/dbStaticLib.c
+++ b/src/ioc/dbStatic/dbStaticLib.c
@@ -1425,7 +1425,6 @@ long dbCreateRecord(DBENTRY *pdbentry,const char *precordName)
if((status = dbAllocRecord(pdbentry,precordName))) return(status);
pNewRecNode->recordname = dbRecordName(pdbentry);
ellInit(&pNewRecNode->infoList);
- /* install record node in list in sorted postion */
ellAdd(preclist, &pNewRecNode->node);
pdbentry->precnode = pNewRecNode;
ppvd = dbPvdAdd(pdbentry->pdbbase,precordType,pNewRecNode);
diff --git a/src/libCom/ellLib/ellSort.c b/src/libCom/ellLib/ellSort.c
index 89f3f3819..ee5f68ca4 100644
--- a/src/libCom/ellLib/ellSort.c
+++ b/src/libCom/ellLib/ellSort.c
@@ -1,3 +1,11 @@
+/*************************************************************************\
+* Copyright (c) 2014 Brookhaven Science Assoc., as Operator of Argonne
+* National Laboratory.
+* Copyright (c) 2016 Michael Davidsaver
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
+\*************************************************************************/
+
/*
* Use of mergesort algorithm based on analysis by
* http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
diff --git a/src/libCom/test/epicsEllTest.c b/src/libCom/test/epicsEllTest.c
index 59a23df0a..78c695466 100644
--- a/src/libCom/test/epicsEllTest.c
+++ b/src/libCom/test/epicsEllTest.c
@@ -1,4 +1,5 @@
/*************************************************************************\
+* Copyright (c) 2016 Michael Davidsaver
* Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
From 55895e6d66dff49b422f773303c9807a21d65648 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver
Date: Wed, 27 Apr 2016 07:58:39 -0400
Subject: [PATCH 08/70] ellSort: comments and redundant asserts
---
src/libCom/ellLib/ellSort.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/libCom/ellLib/ellSort.c b/src/libCom/ellLib/ellSort.c
index ee5f68ca4..2f8f2748b 100644
--- a/src/libCom/ellLib/ellSort.c
+++ b/src/libCom/ellLib/ellSort.c
@@ -49,16 +49,11 @@ void ellSortStable(ELLLIST *pList, pListCmp cmp)
/* shift previous results to inputs */
ellConcat(&INP, pList);
-
- assert(ellCount(pList)==0);
while(ellCount(&INP))
{
ELLNODE *p, *q;
- assert(ellCount(&P)==0);
- assert(ellCount(&Q)==0);
-
/* Pull out the next pair of sub-lists */
ellMoveN(&Q, &INP, insize);
ellMoveN(&P, &INP, insize);
@@ -73,7 +68,7 @@ void ellSortStable(ELLLIST *pList, pListCmp cmp)
}
}
- /* concatinate any remaining to result */
+ /* concatenate any remaining to result */
if(ellFirst(&P))
ellConcat(pList, &P);
else if(ellFirst(&Q))
From 9de65e05d4b267235ce949833b19e3b9915ee94b Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Tue, 27 Sep 2016 15:59:53 +0200
Subject: [PATCH 09/70] libCom/osi: fix timespec definition for MinGW
(cherry-picked from 3.15)
---
src/libCom/osi/os/WIN32/osdTime.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/libCom/osi/os/WIN32/osdTime.h b/src/libCom/osi/os/WIN32/osdTime.h
index 67fc83320..35848f6dc 100644
--- a/src/libCom/osi/os/WIN32/osdTime.h
+++ b/src/libCom/osi/os/WIN32/osdTime.h
@@ -14,11 +14,17 @@
#ifndef INC_osdTime_H
#define INC_osdTime_H
+/* MinGW only has a snippet time.h not protected against multiple inclusion */
+#if defined(__struct_timespec_defined)
+#define _TIMESPEC_DEFINED 1
+#endif
+
#if ! defined(_MINGW) || ! defined(_TIMESPEC_DEFINED)
# if _MSC_VER >= 1900
# include
# else
+#define __struct_timespec_defined 1
#define _TIMESPEC_DEFINED 1
struct timespec {
time_t tv_sec; /* seconds since some epoch */
From 8fb2267218636048297fde9ddc609da4574771c5 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 27 Sep 2016 16:57:53 -0500
Subject: [PATCH 10/70] Revert breaktable point() syntax, not in dbStatic
---
src/tools/DBD/Output.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tools/DBD/Output.pm b/src/tools/DBD/Output.pm
index b82ff98c9..85525269f 100644
--- a/src/tools/DBD/Output.pm
+++ b/src/tools/DBD/Output.pm
@@ -92,7 +92,7 @@ sub OutputBreaktables {
my ($out, $breaktables) = @_;
while (my ($name, $breaktable) = each %{$breaktables}) {
printf $out "breaktable(\"%s\") {\n", $name;
- printf $out " point(%s, %s)\n", @{$_}
+ printf $out " %s, %s\n", @{$_}
foreach $breaktable->points;
print $out "}\n";
}
From c2b17feaf1c5aaf7f61b9132a7d7c0ee496ed891 Mon Sep 17 00:00:00 2001
From: Jeff Hill
Date: Tue, 27 Sep 2016 21:36:28 -0400
Subject: [PATCH 11/70] libCom: Missing unlock in epicsThreadShow for RTEMS
fixes lp:1628323
---
src/libCom/osi/os/RTEMS/osdThread.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libCom/osi/os/RTEMS/osdThread.c b/src/libCom/osi/os/RTEMS/osdThread.c
index b304026e0..8c8363e77 100644
--- a/src/libCom/osi/os/RTEMS/osdThread.c
+++ b/src/libCom/osi/os/RTEMS/osdThread.c
@@ -666,6 +666,7 @@ void epicsThreadShow (epicsThreadId id, unsigned int level)
for (v = taskVarHead ; v != NULL ; v = v->forw) {
if ((rtems_id)id == v->id) {
epicsThreadShowInfo (v, level);
+ taskVarUnlock ();
return;
}
}
From 6623cb01125a61ea394c51e9e536e23a8ccb48b6 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 28 Sep 2016 17:10:38 -0500
Subject: [PATCH 12/70] Back-ported 64-bit MinGW cross-build stuff from 3.15
---
configure/os/CONFIG.Common.win32-x86-mingw | 1 +
.../os/CONFIG.linux-x86.windows-x64-mingw | 22 +++++++++++++
.../os/CONFIG.linux-x86_64.windows-x64-mingw | 9 ++++++
.../os/CONFIG_SITE.linux-x86.win32-x86-mingw | 10 +++---
.../CONFIG_SITE.linux-x86.windows-x64-mingw | 23 ++++++++++++++
...CONFIG_SITE.linux-x86_64.windows-x64-mingw | 8 +++++
documentation/RELEASE_NOTES.html | 31 +++++++++++++++++++
src/libCom/osi/os/WIN32/epicsGetopt.c | 4 +++
src/libCom/osi/os/WIN32/epicsGetopt.h | 8 +++++
src/libCom/osi/os/WIN32/osdThread.c | 2 +-
10 files changed, 113 insertions(+), 5 deletions(-)
create mode 100644 configure/os/CONFIG.linux-x86.windows-x64-mingw
create mode 100644 configure/os/CONFIG.linux-x86_64.windows-x64-mingw
create mode 100644 configure/os/CONFIG_SITE.linux-x86.windows-x64-mingw
create mode 100644 configure/os/CONFIG_SITE.linux-x86_64.windows-x64-mingw
diff --git a/configure/os/CONFIG.Common.win32-x86-mingw b/configure/os/CONFIG.Common.win32-x86-mingw
index a8390e6ef..8b83bf5b0 100644
--- a/configure/os/CONFIG.Common.win32-x86-mingw
+++ b/configure/os/CONFIG.Common.win32-x86-mingw
@@ -9,6 +9,7 @@ include $(CONFIG)/os/CONFIG.Common.UnixCommon
OS_CLASS = WIN32
ARCH_CLASS = x86
+POSIX = NO
# Definitions used when COMMANDLINE_LIBRARY is READLINE
LDLIBS_READLINE = -lreadline -lcurses
diff --git a/configure/os/CONFIG.linux-x86.windows-x64-mingw b/configure/os/CONFIG.linux-x86.windows-x64-mingw
new file mode 100644
index 000000000..3692d6cb2
--- /dev/null
+++ b/configure/os/CONFIG.linux-x86.windows-x64-mingw
@@ -0,0 +1,22 @@
+# CONFIG.linux-x86.windows-x64-mingw
+#
+# Definitions for linux-x86 host windows-x64-mingw target builds
+# Override these definitions in CONFIG_SITE.linux-x86.windows-x64-mingw
+#-------------------------------------------------------
+
+# Include common gnu compiler definitions
+include $(CONFIG)/CONFIG.gnuCommon
+
+# Add resource compiler
+RCCMD = $(GNU_BIN)/$(CMPLR_PREFIX)windres$(CMPLR_SUFFIX) $(INCLUDES) $< $@
+
+# Remove -fPIC flags, add out-implib
+SHRLIB_CFLAGS =
+SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX)
+LOADABLE_SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX)
+
+# No need to explicitly link with gcc library
+GNU_LDLIBS_YES =
+
+# Link with system libraries
+OP_SYS_LDLIBS = -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm
diff --git a/configure/os/CONFIG.linux-x86_64.windows-x64-mingw b/configure/os/CONFIG.linux-x86_64.windows-x64-mingw
new file mode 100644
index 000000000..f84301266
--- /dev/null
+++ b/configure/os/CONFIG.linux-x86_64.windows-x64-mingw
@@ -0,0 +1,9 @@
+# CONFIG.linux-x86_64.windows-x64-mingw
+#
+# Definitions for linux-x86_64 host windows-x64-mingw target builds
+# Override these definitions in CONFIG_SITE.linux-x86_64.windows-x64-mingw
+#-------------------------------------------------------
+
+# Settings as for the linux-x86 host architecture
+include $(CONFIG)/os/CONFIG.linux-x86.windows-x64-mingw
+
diff --git a/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw b/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
index 1d132b74d..cb624242b 100644
--- a/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
+++ b/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
@@ -5,10 +5,9 @@
# Early versions of the MinGW cross-build tools can only build
# static (non-DLL) libraries. Fedora's cross-build of gcc 4.4.6
-# needs these uncommented, other distributions have not been
-# tested with this release of Base:
-SHARED_LIBRARIES = NO
-STATIC_BUILD = YES
+# needs these uncommented, cross-gcc 4.6.3 for Ubuntu does not:
+#SHARED_LIBRARIES = NO
+#STATIC_BUILD = YES
# The cross-build tools are in $(GNU_DIR)/bin
# Default is /usr
@@ -21,3 +20,6 @@ STATIC_BUILD = YES
CMPLR_PREFIX = i686-pc-mingw32-
# Debian?
#CMPLR_PREFIX = i586-mingw32msvc-
+
+# Use static compiler-support libraries
+OP_SYS_LDFLAGS += -static-libgcc -static-libstdc++
diff --git a/configure/os/CONFIG_SITE.linux-x86.windows-x64-mingw b/configure/os/CONFIG_SITE.linux-x86.windows-x64-mingw
new file mode 100644
index 000000000..026410cfe
--- /dev/null
+++ b/configure/os/CONFIG_SITE.linux-x86.windows-x64-mingw
@@ -0,0 +1,23 @@
+# CONFIG_SITE.linux-x86.windows-x64-mingw
+#
+# Configuration for linux-x86 host windows-x64-mingw target builds
+#-------------------------------------------------------
+
+# Early versions of the MinGW cross-build tools can only build
+# static (non-DLL) libraries. For example RHEL's cross-gcc 4.4.6
+# needs these uncommented, cross-gcc 4.6.3 for Ubuntu does not:
+#SHARED_LIBRARIES = NO
+#STATIC_BUILD = YES
+
+# The cross-build tools are in $(GNU_DIR)/bin
+# Default is /usr
+#GNU_DIR = /usr/local
+
+# Different distribution cross-build packages use different prefixes:
+# Ubuntu:
+#CMPLR_PREFIX = i686-w64-mingw32-
+# RHEL:
+CMPLR_PREFIX = x86_64-w64-mingw32-
+
+# Use static compiler-support libraries
+OP_SYS_LDFLAGS += -static-libgcc -static-libstdc++
diff --git a/configure/os/CONFIG_SITE.linux-x86_64.windows-x64-mingw b/configure/os/CONFIG_SITE.linux-x86_64.windows-x64-mingw
new file mode 100644
index 000000000..e98ac7a02
--- /dev/null
+++ b/configure/os/CONFIG_SITE.linux-x86_64.windows-x64-mingw
@@ -0,0 +1,8 @@
+# CONFIG_SITE.linux-x86_64.windows-x64-mingw
+#
+# Configuration for linux-x86_64 host windows-x64-mingw target builds
+#-------------------------------------------------------
+
+# Inherit from the linux-x86 host architecture
+include $(CONFIG)/os/CONFIG_SITE.linux-x86.windows-x64-mingw
+
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 10daf1016..bf44e11ab 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -13,6 +13,37 @@
+MinGW Cross-builds from Linux
+
+Build configuration files have been back-ported from the 3.15 branch that
+allow cross-building of the windows-x64-mingw target from either linux-x86 or
+linux-x86_64 hosts. Similar support for the 32-bit win32-x86-mingw cross-target
+was added in Base-3.14.12.5. Adjust the settings in the configuration file
+configure/os/CONFIG_SITE.linux-x86.windows-x64-mingw and add windows-x64-mingw
+to the CROSS_COMPILER_TARGET_ARCHS variable in configure/CONFIG_SITE or in
+configure/os/CONFIG_SITE.linux-x86.Common.
+
+The Linux MinGW cross-builds now use the compiler flags -static-libgcc
+-static-libstdc++ which avoids having to copy some DLLs onto the Windows
+system to be able to run the generated binaries. These compiler flags can be
+disabled by editing the configure/os/CONFIG_SITE.linux-x86.target file
+for Linux distributions where the cross-build toolset doesn't make static
+versions of those libraries available. The RHEL-6.8 MinGW toolset does not
+package a static version of the library winpthread-1 so on that host OS it is
+still necessary to provide a copy of the libwinpthread-1.dll file for the
+Windows system to use. The simplest way to do this is to manually copy it into
+the IOC application's bin/win32-x86-mingw or bin/windows-x64-mingw directory
+after building the IOC, like this (note that Windows DLLs are always installed
+into the bin directory, not the lib directory):
+
+
+$ cp /usr/i686-w64-mingw32/sys-root/mingw/bin/libwinpthread-1.dll bin/win32-x86-mingw
+$ cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/libwinpthread-1.dll bin/windows-x64-mingw
+
+
+Some additional MinGW-specific changes have also been back-ported from the
+Base-3.15 branch.
+
General Time updates
The iocInit code now performs a sanity check of the current time
diff --git a/src/libCom/osi/os/WIN32/epicsGetopt.c b/src/libCom/osi/os/WIN32/epicsGetopt.c
index 97bb11f47..1ea064ea2 100644
--- a/src/libCom/osi/os/WIN32/epicsGetopt.c
+++ b/src/libCom/osi/os/WIN32/epicsGetopt.c
@@ -1,3 +1,5 @@
+#ifndef _MINGW
+
/*
* Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -121,3 +123,5 @@ int getopt(nargc, nargv, ostr)
}
return (optopt); /* dump back option letter */
}
+
+#endif /* !_MINGW */
diff --git a/src/libCom/osi/os/WIN32/epicsGetopt.h b/src/libCom/osi/os/WIN32/epicsGetopt.h
index aa3bc7422..f92041085 100644
--- a/src/libCom/osi/os/WIN32/epicsGetopt.h
+++ b/src/libCom/osi/os/WIN32/epicsGetopt.h
@@ -12,6 +12,12 @@
#ifndef _EPICS_GETOPT_H
#define _EPICS_GETOPT_H
+#ifdef _MINGW
+
+#include
+
+#else /* _MINGW */
+
#include "shareLib.h"
#ifdef __cplusplus
@@ -28,4 +34,6 @@ epicsShareExtern int optind, opterr, optopt;
}
#endif
+#endif /* _MINGW */
+
#endif /* _EPICS_GETOPT_H */
diff --git a/src/libCom/osi/os/WIN32/osdThread.c b/src/libCom/osi/os/WIN32/osdThread.c
index 7f3d34500..5f61fc894 100644
--- a/src/libCom/osi/os/WIN32/osdThread.c
+++ b/src/libCom/osi/os/WIN32/osdThread.c
@@ -92,7 +92,7 @@ static const int osdRealtimePriorityList [osdRealtimePriorityStateCount] =
#if !defined(EPICS_DLL_NO)
BOOL WINAPI DllMain (
- HANDLE hModule, DWORD dwReason, LPVOID lpReserved )
+ HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved )
{
static DWORD dllHandleIndex;
HMODULE dllHandle = 0;
From 5ad61d25f6b44feddb3557cdb984dcc0c6f521ca Mon Sep 17 00:00:00 2001
From: Xiaoqiang Wang
Date: Thu, 29 Sep 2016 11:23:14 -0500
Subject: [PATCH 13/70] Fix race condition in gdd
---
src/gdd/gddAppTable.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gdd/gddAppTable.cc b/src/gdd/gddAppTable.cc
index 92b0cacec..7a3890559 100644
--- a/src/gdd/gddAppTable.cc
+++ b/src/gdd/gddAppTable.cc
@@ -433,8 +433,10 @@ gddStatus gddApplicationTypeTable::freeDD(gdd* dd)
}
// fprintf(stderr,"Adding DD to free_list %d\n",app);
+ attr_table[group][app].sem.lock ();
dd->setNext(attr_table[group][app].free_list);
attr_table[group][app].free_list=dd;
+ attr_table[group][app].sem.unlock ();
}
else if (attr_table[group][app].type==gddApplicationTypeNormal)
{
From 370240117101e85d7728cb48b947efadf278192c Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Tue, 4 Oct 2016 16:16:42 +0200
Subject: [PATCH 14/70] libCom/osi: add full epicsTime conversion from/to UTC
struct tm (without timezone mechanism)
---
src/libCom/osi/epicsTime.cpp | 89 ++++++++++++++++++++++++++++++++++--
src/libCom/osi/epicsTime.h | 13 +++++-
2 files changed, 96 insertions(+), 6 deletions(-)
diff --git a/src/libCom/osi/epicsTime.cpp b/src/libCom/osi/epicsTime.cpp
index 414bd5d4f..474515170 100644
--- a/src/libCom/osi/epicsTime.cpp
+++ b/src/libCom/osi/epicsTime.cpp
@@ -287,11 +287,80 @@ epicsTime::epicsTime (const local_tm_nano_sec &tm)
throwWithLocation ( formatProblemWithStructTM () );
}
+ // Do the epoch conversion
*this = epicsTime (ansiTimeTicks);
+ // Add the nSec part
+ *this = epicsTime (this->secPastEpoch, tm.nSec);
+}
- unsigned long nSecAdj = tm.nSec % nSecPerSec;
- unsigned long secAdj = tm.nSec / nSecPerSec;
- *this = epicsTime ( this->secPastEpoch+secAdj, this->nSec+nSecAdj );
+//
+// epicsTime (const gm_tm_nano_sec &tm)
+//
+
+// do conversion avoiding the timezone mechanism
+static inline epicsInt32 is_leap(epicsInt32 year)
+{
+ if (year % 400 == 0)
+ return 1;
+ if (year % 100 == 0)
+ return 0;
+ if (year % 4 == 0)
+ return 1;
+ return 0;
+}
+
+static inline epicsInt32 days_from_0(epicsInt32 year)
+{
+ year--;
+ return 365 * year + (year / 400) - (year / 100) + (year / 4);
+}
+
+static inline epicsInt32 days_from_1970(epicsInt32 year)
+{
+ static const int days_from_0_to_1970 = days_from_0(1970);
+ return days_from_0(year) - days_from_0_to_1970;
+}
+
+static inline epicsInt32 days_from_1jan(epicsInt32 year,
+ epicsInt32 month,
+ epicsInt32 day)
+{
+ static const epicsInt32 days[2][12] =
+ {
+ { 0,31,59,90,120,151,181,212,243,273,304,334},
+ { 0,31,60,91,121,152,182,213,244,274,305,335}
+ };
+ return days[is_leap(year)][month-1] + day - 1;
+}
+
+epicsTime::epicsTime (const gm_tm_nano_sec &tm)
+{
+ time_t_wrapper ansiTimeTicks;
+ int year = tm.ansi_tm.tm_year + 1900;
+ int month = tm.ansi_tm.tm_mon;
+ if (month > 11) {
+ year += month / 12;
+ month %= 12;
+ } else if (month < 0) {
+ int years_diff = (-month + 11) / 12;
+ year -= years_diff;
+ month += 12 * years_diff;
+ }
+ month++;
+ int day = tm.ansi_tm.tm_mday;
+ int day_of_year = days_from_1jan(year, month, day);
+ int days_since_epoch = days_from_1970(year) + day_of_year;
+
+ const time_t seconds_in_day = 3600 * 24;
+ ansiTimeTicks.ts = seconds_in_day * days_since_epoch
+ + 3600 * tm.ansi_tm.tm_hour
+ + 60 * tm.ansi_tm.tm_min
+ + tm.ansi_tm.tm_sec;
+
+ // Do the epoch conversion
+ *this = epicsTime (ansiTimeTicks);
+ // Add the nSec part
+ *this = epicsTime (this->secPastEpoch, tm.nSec);
}
//
@@ -905,6 +974,19 @@ extern "C" {
}
return epicsTimeOK;
}
+ epicsShareFunc int epicsShareAPI epicsTimeFromGMTM (epicsTimeStamp *pDest, const struct tm *pSrc, unsigned long nSecSrc)
+ {
+ try {
+ gm_tm_nano_sec tmns;
+ tmns.ansi_tm = *pSrc;
+ tmns.nSec = nSecSrc;
+ *pDest = epicsTime (tmns);
+ }
+ catch (...) {
+ return epicsTimeERROR;
+ }
+ return epicsTimeOK;
+ }
epicsShareFunc int epicsShareAPI epicsTimeToTimespec (struct timespec *pDest, const epicsTimeStamp *pSrc)
{
try {
@@ -1036,4 +1118,3 @@ extern "C" {
}
}
}
-
diff --git a/src/libCom/osi/epicsTime.h b/src/libCom/osi/epicsTime.h
index a36d6afe3..1cb3733bc 100644
--- a/src/libCom/osi/epicsTime.h
+++ b/src/libCom/osi/epicsTime.h
@@ -105,10 +105,12 @@ public:
epicsTime & operator = ( const local_tm_nano_sec & );
/*
- * convert to ANSI Cs "struct tm" (with nano seconds)
+ * convert to and from ANSI Cs "struct tm" (with nano seconds)
* adjusted for GM time (UTC)
*/
operator gm_tm_nano_sec () const;
+ epicsTime ( const gm_tm_nano_sec & );
+ epicsTime & operator = ( const gm_tm_nano_sec & );
/* convert to and from POSIX RTs "struct timespec" */
operator struct timespec () const;
@@ -194,13 +196,15 @@ epicsShareFunc int epicsShareAPI epicsTimeToTime_t (
epicsShareFunc int epicsShareAPI epicsTimeFromTime_t (
epicsTimeStamp * pDest, time_t src );
-/*convert to and from ANSI C's "struct tm" with nano seconds */
+/* convert to and from ANSI C's "struct tm" with nano seconds */
epicsShareFunc int epicsShareAPI epicsTimeToTM (
struct tm * pDest, unsigned long * pNSecDest, const epicsTimeStamp * pSrc );
epicsShareFunc int epicsShareAPI epicsTimeToGMTM (
struct tm * pDest, unsigned long * pNSecDest, const epicsTimeStamp * pSrc );
epicsShareFunc int epicsShareAPI epicsTimeFromTM (
epicsTimeStamp * pDest, const struct tm * pSrc, unsigned long nSecSrc );
+epicsShareFunc int epicsShareAPI epicsTimeFromGMTM (
+ epicsTimeStamp * pDest, const struct tm * pSrc, unsigned long nSecSrc );
/* convert to and from POSIX RT's "struct timespec" */
epicsShareFunc int epicsShareAPI epicsTimeToTimespec (
@@ -312,6 +316,11 @@ inline epicsTime & epicsTime::operator = ( const local_tm_nano_sec & rhs )
return *this = epicsTime ( rhs );
}
+inline epicsTime & epicsTime::operator = ( const gm_tm_nano_sec & rhs )
+{
+ return *this = epicsTime ( rhs );
+}
+
inline epicsTime & epicsTime::operator = ( const struct timespec & rhs )
{
*this = epicsTime ( rhs );
From 67323441ec002b7088f662015b50c7eea1a507c7 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Tue, 4 Oct 2016 16:17:45 +0200
Subject: [PATCH 15/70] libCom/test: add roundtrip test for epicsTime from/to
UTC struct tm conversion
---
src/libCom/test/epicsTimeTest.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/libCom/test/epicsTimeTest.cpp b/src/libCom/test/epicsTimeTest.cpp
index 83d0a8a07..823f57b6f 100644
--- a/src/libCom/test/epicsTimeTest.cpp
+++ b/src/libCom/test/epicsTimeTest.cpp
@@ -48,7 +48,7 @@ MAIN(epicsTimeTest)
const int wasteTime = 100000;
const int nTimes = 10;
- testPlan(15 + nTimes * 18);
+ testPlan(15 + nTimes * 19);
try {
const epicsTimeStamp epochTS = {0, 0};
@@ -205,6 +205,11 @@ MAIN(epicsTimeTest)
epicsTime beginANSI = ansiDate;
testOk1(beginANSI + diff == now);
+ // test struct gmtm round-trip conversion
+ gm_tm_nano_sec ansiGmDate = begin;
+ epicsTime beginGMANSI = ansiGmDate;
+ testOk1(beginGMANSI + diff == now);
+
// test struct timespec round-trip conversion
struct timespec ts = begin;
epicsTime beginTS = ts;
From 4da0e2c27ec87f42afe9cf91af87e152dec69e67 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Wed, 5 Oct 2016 09:41:49 +0200
Subject: [PATCH 16/70] Add release note info for the epicsTime change
---
documentation/RELEASE_NOTES.html | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index bf44e11ab..52ef97063 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -13,6 +13,15 @@
+Additional epicsTime conversion
+
+The EPICS timestamp library (epicsTime) inside libCom's OSI layer has
+been extended by routines that convert from struct tm to the EPICS
+internal epicsTime type, assuming UTC - i.e. without going through
+the timezone mechanism. This solves issues with converting from the structured
+type to the EPICS timestamp at driver level from multiple threads at a high
+repetition rate, where the timezone mechanism was blocking on file access.
+
MinGW Cross-builds from Linux
Build configuration files have been back-ported from the 3.15 branch that
From 2fd298b4403cf5ba49118a2ec78c001ac9ee6712 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 5 Oct 2016 15:11:57 -0500
Subject: [PATCH 17/70] Fixed issues with previous epicsTime.cpp changes
---
src/libCom/osi/epicsTime.cpp | 55 ++++++++++++++++++------------------
1 file changed, 28 insertions(+), 27 deletions(-)
diff --git a/src/libCom/osi/epicsTime.cpp b/src/libCom/osi/epicsTime.cpp
index eedf8860d..23c236da2 100644
--- a/src/libCom/osi/epicsTime.cpp
+++ b/src/libCom/osi/epicsTime.cpp
@@ -60,7 +60,13 @@ static const unsigned long NTP_TIME_AT_EPICS_EPOCH =
// epicsTime (const unsigned long secIn, const unsigned long nSecIn)
//
inline epicsTime::epicsTime (const unsigned long secIn, const unsigned long nSecIn) :
- secPastEpoch ( nSecIn / nSecPerSec + secIn ), nSec ( nSecIn % nSecPerSec ) {}
+ secPastEpoch ( secIn ), nSec ( nSecIn )
+{
+ if (nSecIn >= nSecPerSec) {
+ this->secPastEpoch += nSecIn / nSecPerSec;
+ this->nSec = nSecIn % nSecPerSec;
+ }
+}
//
// epicsTimeLoadTimeInit
@@ -108,14 +114,27 @@ epicsTimeLoadTimeInit::epicsTimeLoadTimeInit ()
}
//
-// epicsTime::addNanoSec ()
+// private epicsTime::addNanoSec ()
//
-// many of the UNIX timestamp formats have nano sec stored as a long
+// Most formats keep the nSec value as an unsigned long, so are +ve.
+// struct timeval's tv_usec may be -1, but I think that means error,
+// so this private method never needs to handle -ve offsets.
//
inline void epicsTime::addNanoSec (long nSecAdj)
{
- double secAdj = static_cast (nSecAdj) / nSecPerSec;
- *this += secAdj;
+ if (nSecAdj <= 0)
+ return;
+
+ if (static_cast(nSecAdj) >= nSecPerSec) {
+ this->secPastEpoch += nSecAdj / nSecPerSec;
+ nSecAdj %= nSecPerSec;
+ }
+
+ this->nSec += nSecAdj; // Can't overflow
+ if (this->nSec >= nSecPerSec) {
+ this->secPastEpoch++;
+ this->nSec -= nSecPerSec;
+ }
}
//
@@ -286,17 +305,8 @@ epicsTime::epicsTime (const local_tm_nano_sec &tm)
throwWithLocation ( formatProblemWithStructTM () );
}
- unsigned long nSec = tm.nSec;
- // Handle nSec overflows
- if (nSec >= nSecPerSec) {
- ansiTimeTicks.ts += nSec / nSecPerSec;
- nSec %= nSecPerSec;
- }
-
- // Do the epoch conversion
- *this = epicsTime (ansiTimeTicks);
- // Set the nSec part
- this->nSec = nSec;
+ *this = epicsTime(ansiTimeTicks);
+ this->addNanoSec(tm.nSec);
}
//
@@ -361,17 +371,8 @@ epicsTime::epicsTime (const gm_tm_nano_sec &tm)
* 60 + tm.ansi_tm.tm_min)
* 60 + tm.ansi_tm.tm_sec;
- unsigned long nSec = tm.nSec;
- // Handle nSec overflows
- if (nSec >= nSecPerSec) {
- ansiTimeTicks.ts += nSec / nSecPerSec;
- nSec %= nSecPerSec;
- }
-
- // Do the epoch conversion
*this = epicsTime(ansiTimeTicks);
- // Set the nSec part
- this->nSec = nSec;
+ this->addNanoSec(tm.nSec);
}
//
@@ -770,7 +771,7 @@ double epicsTime::operator - (const epicsTime &rhs) const
// so the unsigned to signed conversion is ok
//
if (this->nSec>=rhs.nSec) {
- nSecRes = this->nSec - rhs.nSec;
+ nSecRes = this->nSec - rhs.nSec;
}
else {
nSecRes = rhs.nSec - this->nSec;
From 843fb8ca958bdf7b12673e0975e1b3be870d7642 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Thu, 6 Oct 2016 13:02:46 +0200
Subject: [PATCH 18/70] dbStatic: update dbCreateAlias() to add to record list
(instead of insertion sort)
---
src/ioc/dbStatic/dbStaticLib.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/ioc/dbStatic/dbStaticLib.c b/src/ioc/dbStatic/dbStaticLib.c
index 166979655..aa427d2d9 100644
--- a/src/ioc/dbStatic/dbStaticLib.c
+++ b/src/ioc/dbStatic/dbStaticLib.c
@@ -1698,18 +1698,7 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
if (!(precnode->flags & DBRN_FLAGS_ISALIAS))
precnode->flags |= DBRN_FLAGS_HASALIAS;
ellInit(&pnewnode->infoList);
- /* install record node in list in sorted postion */
- status = dbFirstRecord(pdbentry);
- while (!status) {
- if (strcmp(alias, dbGetRecordName(pdbentry)) < 0) break;
- status = dbNextRecord(pdbentry);
- }
- if (!status) {
- precnode = pdbentry->precnode;
- ellInsert(preclist, ellPrevious(&precnode->node), &pnewnode->node);
- } else {
- ellAdd(preclist, &pnewnode->node);
- }
+ ellAdd(preclist, &pnewnode->node);
precordType->no_aliases++;
pdbentry->precnode = pnewnode;
ppvd = dbPvdAdd(pdbentry->pdbbase, precordType, pnewnode);
From 344928bdc6307a80ff45056abdc42f5b5e0bc262 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Thu, 6 Oct 2016 13:31:40 +0200
Subject: [PATCH 19/70] dbStatic: remove dbRenameRecord()
---
src/ioc/dbStatic/dbStaticLib.c | 46 ----------------------------------
src/ioc/dbStatic/dbStaticLib.h | 2 --
2 files changed, 48 deletions(-)
diff --git a/src/ioc/dbStatic/dbStaticLib.c b/src/ioc/dbStatic/dbStaticLib.c
index aa427d2d9..b87e89fbc 100644
--- a/src/ioc/dbStatic/dbStaticLib.c
+++ b/src/ioc/dbStatic/dbStaticLib.c
@@ -1603,52 +1603,6 @@ char * dbGetRecordName(DBENTRY *pdbentry)
return precnode->recordname;
}
-long dbRenameRecord(DBENTRY *pdbentry,const char *newName)
-{
- dbBase *pdbbase = pdbentry->pdbbase;
- dbRecordType *precordType = pdbentry->precordType;
- dbFldDes *pdbFldDes;
- dbRecordNode *precnode = pdbentry->precnode;
- PVDENTRY *ppvd;
- ELLLIST *preclist;
- dbRecordNode *plistnode;
- long status;
- DBENTRY dbentry;
-
- if(!precordType) return(S_dbLib_recordTypeNotFound);
- /*Get size of NAME field*/
- pdbFldDes = precordType->papFldDes[0];
- if(!pdbFldDes || (strcmp(pdbFldDes->name,"NAME")!=0))
- return(S_dbLib_nameLength);
- if((int)strlen(newName)>=pdbFldDes->size) return(S_dbLib_nameLength);
- if (!precnode || dbIsAlias(pdbentry)) return S_dbLib_recNotFound;
- dbInitEntry(pdbentry->pdbbase,&dbentry);
- status = dbFindRecord(&dbentry,newName);
- dbFinishEntry(&dbentry);
- if(!status) return(S_dbLib_recExists);
- dbPvdDelete(pdbbase,precnode);
- pdbentry->pflddes = precordType->papFldDes[0];
- if((status = dbGetFieldAddress(pdbentry))) return(status);
- strcpy(pdbentry->pfield,newName);
- ppvd = dbPvdAdd(pdbbase,precordType,precnode);
- if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);}
- /*remove from record list and reinstall in sorted order*/
- preclist = &precordType->recList;
- ellDelete(preclist,&precnode->node);
- plistnode = (dbRecordNode *)ellFirst(preclist);
- while(plistnode) {
- pdbentry->precnode = plistnode;
- if(strcmp(newName,dbGetRecordName(pdbentry)) >=0) break;
- plistnode = (dbRecordNode *)ellNext(&plistnode->node);
- }
- if(plistnode)
- ellInsert(preclist,ellPrevious(&plistnode->node),&precnode->node);
- else
- ellAdd(preclist,&precnode->node);
- /*Leave pdbentry pointing to newly renamed record*/
- return(dbFindRecord(pdbentry,newName));
-}
-
long dbVisibleRecord(DBENTRY *pdbentry)
{
dbRecordNode *precnode = pdbentry->precnode;
diff --git a/src/ioc/dbStatic/dbStaticLib.h b/src/ioc/dbStatic/dbStaticLib.h
index de94dc674..1619a9090 100644
--- a/src/ioc/dbStatic/dbStaticLib.h
+++ b/src/ioc/dbStatic/dbStaticLib.h
@@ -146,8 +146,6 @@ epicsShareFunc long dbNextRecord(DBENTRY *pdbentry);
epicsShareFunc int dbGetNRecords(DBENTRY *pdbentry);
epicsShareFunc int dbGetNAliases(DBENTRY *pdbentry);
epicsShareFunc char * dbGetRecordName(DBENTRY *pdbentry);
-epicsShareFunc long dbRenameRecord(DBENTRY *pdbentry,
- const char *newName);
epicsShareFunc long dbCopyRecord(DBENTRY *pdbentry,
const char *newRecordName, int overWriteOK);
From 336bd656c8e015aa98358f0959e6ed6759d1db5f Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Thu, 6 Oct 2016 15:36:44 +0200
Subject: [PATCH 20/70] dbStatic: only sort records alphabetically if
explicitly configured (default: no sorting)
---
documentation/RELEASE_NOTES.html | 10 ++++++++++
src/ioc/dbStatic/dbLexRoutines.c | 5 ++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 1c8a906c5..0a1346075 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -15,6 +15,16 @@
Changes made on the 3.15 branch since 3.15.4
+dbStatic Library Cleanup
+
+Loading of database files has been optimized to avoid overproportionally
+long loading times for large databases. As a part of this, the alphabetical
+ordering of records instances (within a record type) has been dropped. In the
+unexpected case that applications were relying on the alphabetic order, setting
+dbRecordsAbcSorted = 1 before loading the databases will retain the
+old behavior.
+
+
Changes from the 3.14 branch since 3.15.4
diff --git a/src/ioc/dbStatic/dbLexRoutines.c b/src/ioc/dbStatic/dbLexRoutines.c
index b9a1923d4..05edab618 100644
--- a/src/ioc/dbStatic/dbLexRoutines.c
+++ b/src/ioc/dbStatic/dbLexRoutines.c
@@ -50,6 +50,9 @@ epicsExportAddress(int,dbBptNotMonotonic);
epicsShareDef int dbQuietMacroWarnings=0;
epicsExportAddress(int,dbQuietMacroWarnings);
+epicsShareDef int dbRecordsAbcSorted=0;
+epicsExportAddress(int,dbRecordsAbcSorted);
+
/*private routines */
static void yyerrorAbort(char *str);
static void allocTemp(void *pvoid);
@@ -298,7 +301,7 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
dbFinishEntry(pdbEntry);
}
cleanup:
- {
+ if(dbRecordsAbcSorted) {
ELLNODE *cur;
for(cur = ellFirst(&pdbbase->recordTypeList); cur; cur=ellNext(cur))
{
From 768c6234bd891f2792ec53dddc00473216a44804 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Thu, 6 Oct 2016 15:44:02 +0200
Subject: [PATCH 21/70] Mention dbRenameRecord() removal in release notes
---
documentation/RELEASE_NOTES.html | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 0a1346075..fc0f5d0ee 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -24,6 +24,10 @@ unexpected case that applications were relying on the alphabetic order, setting
dbRecordsAbcSorted = 1 before loading the databases will retain the
old behavior.
+The routine dbRenameRecord() has been removed, as it was intended
+to be used by database configuration tools linked against a host side version
+of the dbStatic library that is not being built anymore.
+
Changes from the 3.14 branch since 3.15.4
From 928ebe82bd51d92b82bb98eafda4648d3ab0b97f Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 6 Oct 2016 13:13:59 -0500
Subject: [PATCH 22/70] Build rules: Enable tests only when we can run them
---
configure/RULES_BUILD | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
index 80494cb84..978d616e5 100644
--- a/configure/RULES_BUILD
+++ b/configure/RULES_BUILD
@@ -91,13 +91,17 @@ include $(CONFIG)/RULES_TARGET
PRODTARGETS += $(PRODNAME) $(MUNCHNAME) $(CTDT_SRCS) $(CTDT_OBJS) $(NMS)
#---------------------------------------------------------------
-# Generate a test specification if any tests are defined.
+# Test specifications and test result files
#
ifneq (,$(strip $(TESTS)))
TARGETS += testspec
endif
+# Enable testing if this host can run tests on the current target
+ifneq (,$(findstring $(T_A),$(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS)))
+RUNTESTS_ENABLED = YES
TAPFILES += $(TESTSCRIPTS:.t=.tap)
+endif
#---------------------------------------------------------------
# Libraries
@@ -337,7 +341,7 @@ $(MODNAME): %$(MODEXT): %$(EXE)
$(LINK.mod)
runtests: $(TESTSCRIPTS)
-ifneq (,$(findstring $(T_A),$(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS)))
+ifdef RUNTESTS_ENABLED
-$(PERL) -MTest::Harness -e 'runtests @ARGV if @ARGV;' $^
endif
@@ -352,7 +356,7 @@ tapfiles: $(TESTSCRIPTS) $(TAPFILES)
# A .tap file is the output from running the associated test script
%.tap: %.t
-ifneq (,$(findstring $(T_A),$(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS)))
+ifdef RUNTESTS_ENABLED
-$(PERL) $< -tap > $@
endif
From de6a44204856c08a00c29d96abcea261c6ffa5ad Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Fri, 7 Oct 2016 10:29:28 +0200
Subject: [PATCH 23/70] dbStatic: fix compiler warnings (unused variables)
---
src/ioc/dbStatic/dbStaticLib.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/ioc/dbStatic/dbStaticLib.c b/src/ioc/dbStatic/dbStaticLib.c
index b87e89fbc..971063212 100644
--- a/src/ioc/dbStatic/dbStaticLib.c
+++ b/src/ioc/dbStatic/dbStaticLib.c
@@ -1402,7 +1402,6 @@ long dbCreateRecord(DBENTRY *pdbentry,const char *precordName)
dbFldDes *pdbFldDes;
PVDENTRY *ppvd;
ELLLIST *preclist = NULL;
- dbRecordNode *precnode = NULL;
dbRecordNode *pNewRecNode = NULL;
long status = 0;
@@ -1636,7 +1635,6 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
dbRecordNode *pnewnode;
PVDENTRY *ppvd;
ELLLIST *preclist = NULL;
- long status;
if (!precordType) return S_dbLib_recordTypeNotFound;
if (!precnode) return S_dbLib_recNotFound;
From 3fa8f2ac22a244c3559788e32b8a1527cfed06bc Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Fri, 7 Oct 2016 10:52:13 +0200
Subject: [PATCH 24/70] libCom/ellLib: make sort comparator args const pointers
---
src/libCom/ellLib/ellLib.h | 2 +-
src/libCom/test/epicsEllTest.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libCom/ellLib/ellLib.h b/src/libCom/ellLib/ellLib.h
index 300a2df3f..52b58d169 100644
--- a/src/libCom/ellLib/ellLib.h
+++ b/src/libCom/ellLib/ellLib.h
@@ -56,7 +56,7 @@ epicsShareFunc void ellInsert (ELLLIST *plist, ELLNODE *pPrev, ELLNODE *pNode);
epicsShareFunc ELLNODE * ellNth (ELLLIST *pList, int nodeNum);
epicsShareFunc ELLNODE * ellNStep (ELLNODE *pNode, int nStep);
epicsShareFunc int ellFind (ELLLIST *pList, ELLNODE *pNode);
-typedef int (*pListCmp)(ELLNODE* A, ELLNODE* B);
+typedef int (*pListCmp)(const ELLNODE* A, const ELLNODE* B);
epicsShareFunc void ellSortStable(ELLLIST *pList, pListCmp);
epicsShareFunc void ellFree2 (ELLLIST *pList, FREEFUNC freeFunc);
epicsShareFunc void ellVerify (ELLLIST *pList);
diff --git a/src/libCom/test/epicsEllTest.c b/src/libCom/test/epicsEllTest.c
index 78c695466..62ee14e39 100644
--- a/src/libCom/test/epicsEllTest.c
+++ b/src/libCom/test/epicsEllTest.c
@@ -196,7 +196,7 @@ static void testList(void)
typedef struct { int A, B; } input_t;
-static int myItemCmp(ELLNODE *a, ELLNODE *b)
+static int myItemCmp(const ELLNODE *a, const ELLNODE *b)
{
struct myItem *A = CONTAINER(a, struct myItem, node),
*B = CONTAINER(b, struct myItem, node);
From a32faa573c6f4f043cef3429bd5318bfa7f1064c Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Fri, 7 Oct 2016 11:56:06 +0200
Subject: [PATCH 25/70] ioc/misc: add dbRecordsAbcSorted to dbCore.dbd
---
src/ioc/misc/dbCore.dbd | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ioc/misc/dbCore.dbd b/src/ioc/misc/dbCore.dbd
index 4b515141b..a2ce45806 100644
--- a/src/ioc/misc/dbCore.dbd
+++ b/src/ioc/misc/dbCore.dbd
@@ -11,6 +11,7 @@ variable(asCaDebug,int)
# Static database access variables
variable(dbRecordsOnceOnly,int)
+variable(dbRecordsAbcSorted,int)
variable(dbBptNotMonotonic,int)
variable(dbQuietMacroWarnings,int)
From 6e2705c23f87ea693a8fd8676c10db18037fd6e9 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 10 Oct 2016 15:12:26 -0500
Subject: [PATCH 26/70] Merged commit 12741 from Michael's pcas-fake-dynamic
branch
---
documentation/RELEASE_NOTES.html | 9 +++++++++
src/cas/generic/caHdrLargeArray.h | 2 +-
src/cas/generic/casCtx.h | 3 +++
src/cas/generic/casStrmClient.cc | 26 +++++++++++++++++---------
src/cas/generic/casStrmClient.h | 2 +-
5 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 52ef97063..14258f352 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -13,6 +13,15 @@
+Add dynamic (variable length) array support to PCAS
+
+Dynamic array sizing support was added to the IOC server (RSRV) in the
+Base-3.14.12 release, but has not until now been supported in the Portable
+Channel Access Server
(PCAS). Channel Access server applications using the
+PCAS will have to be modified slightly to provide full support for variable
+length arrays, but unmodified applications will continue to build and work as
+before against this release.
+
Additional epicsTime conversion
The EPICS timestamp library (epicsTime) inside libCom's OSI layer has
diff --git a/src/cas/generic/caHdrLargeArray.h b/src/cas/generic/caHdrLargeArray.h
index 89b0d6d4b..7bda002e9 100644
--- a/src/cas/generic/caHdrLargeArray.h
+++ b/src/cas/generic/caHdrLargeArray.h
@@ -30,7 +30,7 @@
# include "shareLib.h"
#endif
-static const unsigned char CA_MINOR_PROTOCOL_REVISION = 12;
+static const unsigned char CA_MINOR_PROTOCOL_REVISION = 13;
typedef ca_uint32_t caResId;
diff --git a/src/cas/generic/casCtx.h b/src/cas/generic/casCtx.h
index 706376e77..eab644685 100644
--- a/src/cas/generic/casCtx.h
+++ b/src/cas/generic/casCtx.h
@@ -18,6 +18,8 @@
#include "caHdrLargeArray.h"
+class casStrmClient;
+
class casCtx {
public:
casCtx();
@@ -41,6 +43,7 @@ private:
casChannelI * pChannel;
casPVI * pPV;
unsigned nAsyncIO; // checks for improper use of async io
+ friend class casStrmClient;
};
inline const caHdrLargeArray * casCtx::getMsg() const
diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc
index 5bcefb682..468aa17a5 100644
--- a/src/cas/generic/casStrmClient.cc
+++ b/src/cas/generic/casStrmClient.cc
@@ -390,14 +390,12 @@ caStatus casStrmClient::echoAction ( epicsGuard < casClientMutex > & )
//
// casStrmClient::verifyRequest()
//
-caStatus casStrmClient::verifyRequest ( casChannelI * & pChan )
+caStatus casStrmClient::verifyRequest (casChannelI * & pChan , bool allowdyn)
{
- const caHdrLargeArray * mp = this->ctx.getMsg();
-
//
// channel exists for this resource id ?
//
- chronIntId tmpId ( mp->m_cid );
+ chronIntId tmpId ( ctx.msg.m_cid );
pChan = this->chanTable.lookup ( tmpId );
if ( ! pChan ) {
return ECA_BADCHID;
@@ -406,14 +404,24 @@ caStatus casStrmClient::verifyRequest ( casChannelI * & pChan )
//
// data type out of range ?
//
- if ( mp->m_dataType > ((unsigned)LAST_BUFFER_TYPE) ) {
+ if ( ctx.msg.m_dataType > ((unsigned)LAST_BUFFER_TYPE) ) {
return ECA_BADTYPE;
}
//
// element count out of range ?
//
- if ( mp->m_count > pChan->getPVI().nativeCount() || mp->m_count == 0u ) {
+ if ( allowdyn && ctx.msg.m_count==0 &&
+ CA_V413 ( this->minor_version_number ) ) {
+ // Hack
+ // Since GDD interface doesn't support variable sized arrays
+ // we present dynamic requests as max size.
+ // This allows PCAS to claim support for dynamic arrays w/o
+ // going to the trouble of fixing GDD.
+ ctx.msg.m_count = pChan->getPVI().nativeCount();
+ }
+ else if ( ctx.msg.m_count > pChan->getPVI().nativeCount() ||
+ ctx.msg.m_count == 0u ) {
return ECA_BADCOUNT;
}
@@ -446,7 +454,7 @@ caStatus casStrmClient::readAction ( epicsGuard < casClientMutex > & guard )
casChannelI * pChan;
{
- caStatus status = this->verifyRequest ( pChan );
+ caStatus status = this->verifyRequest ( pChan, true );
if ( status != ECA_NORMAL ) {
if ( pChan ) {
return this->sendErr ( guard, mp, pChan->getCID(),
@@ -587,7 +595,7 @@ caStatus casStrmClient::readNotifyAction ( epicsGuard < casClientMutex > & guard
casChannelI * pChan;
{
- caStatus status = this->verifyRequest ( pChan );
+ caStatus status = this->verifyRequest ( pChan, true );
if ( status != ECA_NORMAL ) {
return this->readNotifyFailureResponse ( guard, * mp, status );
}
@@ -1942,7 +1950,7 @@ caStatus casStrmClient::eventAddAction (
casChannelI *pciu;
{
- caStatus status = casStrmClient::verifyRequest ( pciu );
+ caStatus status = casStrmClient::verifyRequest ( pciu, true );
if ( status != ECA_NORMAL ) {
if ( pciu ) {
return this->sendErr ( guard, mp,
diff --git a/src/cas/generic/casStrmClient.h b/src/cas/generic/casStrmClient.h
index 3f6c0a51b..0fdd36bb4 100644
--- a/src/cas/generic/casStrmClient.h
+++ b/src/cas/generic/casStrmClient.h
@@ -69,7 +69,7 @@ private:
bool responseIsPending;
caStatus createChannel ( const char * pName );
- caStatus verifyRequest ( casChannelI * & pChan );
+ caStatus verifyRequest ( casChannelI * & pChan, bool allowdyn = false );
typedef caStatus ( casStrmClient :: * pCASMsgHandler )
( epicsGuard < casClientMutex > & );
static pCASMsgHandler const msgHandlers[CA_PROTO_LAST_CMMD+1u];
From f73d48bb6a3e4015b9c82512cda38b4e07464bb5 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 10 Oct 2016 17:19:10 -0500
Subject: [PATCH 27/70] Apply fix for lp:1581505
---
src/libCom/osi/os/default/osdNetIntf.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/libCom/osi/os/default/osdNetIntf.c b/src/libCom/osi/os/default/osdNetIntf.c
index 1ad6360c1..21ccfa7bc 100644
--- a/src/libCom/osi/os/default/osdNetIntf.c
+++ b/src/libCom/osi/os/default/osdNetIntf.c
@@ -196,14 +196,22 @@ epicsShareFunc void epicsShareAPI osiSockDiscoverBroadcastAddresses
* interface.
*/
if ( pIfreqList->ifr_flags & IFF_BROADCAST ) {
+ osiSockAddr baddr;
status = socket_ioctl (socket, SIOCGIFBRDADDR, pIfreqList);
if ( status ) {
errlogPrintf ("osiSockDiscoverBroadcastAddresses(): net intf \"%s\": bcast addr fetch fail\n", pIfreqList->ifr_name);
free ( pNewNode );
continue;
}
- pNewNode->addr.sa = pIfreqList->ifr_broadaddr;
- ifDepenDebugPrintf ( ( "found broadcast addr = %x\n", ntohl ( pNewNode->addr.ia.sin_addr.s_addr ) ) );
+ baddr.sa = pIfreqList->ifr_broadaddr;
+ if (baddr.ia.sin_family==AF_INET && baddr.ia.sin_addr.s_addr != INADDR_ANY) {
+ pNewNode->addr.sa = pIfreqList->ifr_broadaddr;
+ ifDepenDebugPrintf ( ( "found broadcast addr = %x\n", ntohl ( baddr.ia.sin_addr.s_addr ) ) );
+ } else {
+ ifDepenDebugPrintf ( ( "Ignoring broadcast addr = \n", ntohl ( baddr.ia.sin_addr.s_addr ) ) );
+ free ( pNewNode );
+ continue;
+ }
}
#if defined (IFF_POINTOPOINT)
else if ( pIfreqList->ifr_flags & IFF_POINTOPOINT ) {
From 9ac237b3dee4e9e1a023970304d7ca821a1c5ff3 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Wed, 12 Oct 2016 13:41:55 +0200
Subject: [PATCH 28/70] cas: Add real implementation for variable length arrays
(Bruce Hill, Matej Sekoranja)
---
src/cas/generic/casStrmClient.cc | 69 +++++++++++++++++---------------
1 file changed, 36 insertions(+), 33 deletions(-)
diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc
index 468aa17a5..b1e321120 100644
--- a/src/cas/generic/casStrmClient.cc
+++ b/src/cas/generic/casStrmClient.cc
@@ -411,17 +411,8 @@ caStatus casStrmClient::verifyRequest (casChannelI * & pChan , bool allowdyn)
//
// element count out of range ?
//
- if ( allowdyn && ctx.msg.m_count==0 &&
- CA_V413 ( this->minor_version_number ) ) {
- // Hack
- // Since GDD interface doesn't support variable sized arrays
- // we present dynamic requests as max size.
- // This allows PCAS to claim support for dynamic arrays w/o
- // going to the trouble of fixing GDD.
- ctx.msg.m_count = pChan->getPVI().nativeCount();
- }
- else if ( ctx.msg.m_count > pChan->getPVI().nativeCount() ||
- ctx.msg.m_count == 0u ) {
+ if ( ctx.msg.m_count > pChan->getPVI().nativeCount() ||
+ ( !allowdyn && ctx.msg.m_count == 0u ) ) {
return ECA_BADCOUNT;
}
@@ -454,7 +445,7 @@ caStatus casStrmClient::readAction ( epicsGuard < casClientMutex > & guard )
casChannelI * pChan;
{
- caStatus status = this->verifyRequest ( pChan, true );
+ caStatus status = this->verifyRequest ( pChan, CA_V413 ( this->minor_version_number ) );
if ( status != ECA_NORMAL ) {
if ( pChan ) {
return this->sendErr ( guard, mp, pChan->getCID(),
@@ -541,11 +532,15 @@ caStatus casStrmClient::readResponse ( epicsGuard < casClientMutex > & guard,
pChan->getCID(), status, ECA_GETFAIL );
}
+ ca_uint32_t count = (msg.m_count == 0) ?
+ (ca_uint32_t)desc.getDataSizeElements() :
+ msg.m_count;
+
void * pPayload;
{
- unsigned payloadSize = dbr_size_n ( msg.m_dataType, msg.m_count );
+ unsigned payloadSize = dbr_size_n ( msg.m_dataType, count );
caStatus localStatus = this->out.copyInHeader ( msg.m_cmmd, payloadSize,
- msg.m_dataType, msg.m_count, pChan->getCID (),
+ msg.m_dataType, count, pChan->getCID (),
msg.m_available, & pPayload );
if ( localStatus ) {
if ( localStatus==S_cas_hugeRequest ) {
@@ -561,21 +556,21 @@ caStatus casStrmClient::readResponse ( epicsGuard < casClientMutex > & guard,
// (places the data in network format)
//
int mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr(
- pPayload, msg.m_count, desc, pChan->enumStringTable() );
+ pPayload, count, desc, pChan->enumStringTable() );
if ( mapDBRStatus < 0 ) {
desc.dump ();
errPrintf ( S_cas_badBounds, __FILE__, __LINE__, "- get with PV=%s type=%u count=%u",
- pChan->getPVI().getName(), msg.m_dataType, msg.m_count );
+ pChan->getPVI().getName(), msg.m_dataType, count );
return this->sendErrWithEpicsStatus (
guard, & msg, pChan->getCID(), S_cas_badBounds, ECA_GETFAIL );
}
int cacStatus = caNetConvert (
- msg.m_dataType, pPayload, pPayload, true, msg.m_count );
+ msg.m_dataType, pPayload, pPayload, true, count );
if ( cacStatus != ECA_NORMAL ) {
return this->sendErrWithEpicsStatus (
guard, & msg, pChan->getCID(), S_cas_internal, cacStatus );
}
- if ( msg.m_dataType == DBR_STRING && msg.m_count == 1u ) {
+ if ( msg.m_dataType == DBR_STRING && count == 1u ) {
unsigned reducedPayloadSize = strlen ( static_cast < char * > ( pPayload ) ) + 1u;
this->out.commitMsg ( reducedPayloadSize );
}
@@ -595,7 +590,7 @@ caStatus casStrmClient::readNotifyAction ( epicsGuard < casClientMutex > & guard
casChannelI * pChan;
{
- caStatus status = this->verifyRequest ( pChan, true );
+ caStatus status = this->verifyRequest ( pChan, CA_V413 ( this->minor_version_number ) );
if ( status != ECA_NORMAL ) {
return this->readNotifyFailureResponse ( guard, * mp, status );
}
@@ -666,11 +661,15 @@ caStatus casStrmClient::readNotifyResponse ( epicsGuard < casClientMutex > & gua
return ecaStatus;
}
+ ca_uint32_t count = (msg.m_count == 0) ?
+ (ca_uint32_t)desc.getDataSizeElements() :
+ msg.m_count;
+
void *pPayload;
{
- unsigned size = dbr_size_n ( msg.m_dataType, msg.m_count );
+ unsigned size = dbr_size_n ( msg.m_dataType, count );
caStatus status = this->out.copyInHeader ( msg.m_cmmd, size,
- msg.m_dataType, msg.m_count, ECA_NORMAL,
+ msg.m_dataType, count, ECA_NORMAL,
msg.m_available, & pPayload );
if ( status ) {
if ( status == S_cas_hugeRequest ) {
@@ -685,23 +684,23 @@ caStatus casStrmClient::readNotifyResponse ( epicsGuard < casClientMutex > & gua
// convert gdd to db_access type
//
int mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr ( pPayload,
- msg.m_count, desc, pChan->enumStringTable() );
+ count, desc, pChan->enumStringTable() );
if ( mapDBRStatus < 0 ) {
desc.dump();
errPrintf ( S_cas_badBounds, __FILE__, __LINE__,
"- get notify with PV=%s type=%u count=%u",
- pChan->getPVI().getName(), msg.m_dataType, msg.m_count );
+ pChan->getPVI().getName(), msg.m_dataType, count );
return this->readNotifyFailureResponse ( guard, msg, ECA_NOCONVERT );
}
int cacStatus = caNetConvert (
- msg.m_dataType, pPayload, pPayload, true, msg.m_count );
+ msg.m_dataType, pPayload, pPayload, true, count );
if ( cacStatus != ECA_NORMAL ) {
return this->sendErrWithEpicsStatus (
guard, & msg, pChan->getCID(), S_cas_internal, cacStatus );
}
- if ( msg.m_dataType == DBR_STRING && msg.m_count == 1u ) {
+ if ( msg.m_dataType == DBR_STRING && count == 1u ) {
unsigned reducedPayloadSize = strlen ( static_cast < char * > ( pPayload ) ) + 1u;
this->out.commitMsg ( reducedPayloadSize );
}
@@ -859,11 +858,15 @@ caStatus casStrmClient::monitorResponse (
casChannelI & chan, const caHdrLargeArray & msg,
const gdd & desc, const caStatus completionStatus )
{
+ ca_uint32_t count = (msg.m_count == 0) ?
+ (ca_uint32_t)desc.getDataSizeElements() :
+ msg.m_count;
+
void * pPayload = 0;
{
- ca_uint32_t size = dbr_size_n ( msg.m_dataType, msg.m_count );
+ ca_uint32_t size = dbr_size_n ( msg.m_dataType, count );
caStatus status = out.copyInHeader ( msg.m_cmmd, size,
- msg.m_dataType, msg.m_count, ECA_NORMAL,
+ msg.m_dataType, count, ECA_NORMAL,
msg.m_available, & pPayload );
if ( status ) {
if ( status == S_cas_hugeRequest ) {
@@ -881,7 +884,7 @@ caStatus casStrmClient::monitorResponse (
gdd * pDBRDD = 0;
if ( completionStatus == S_cas_success ) {
- caStatus status = createDBRDD ( msg.m_dataType, msg.m_count, pDBRDD );
+ caStatus status = createDBRDD ( msg.m_dataType, count, pDBRDD );
if ( status != S_cas_success ) {
caStatus ecaStatus;
if ( status == S_cas_badType ) {
@@ -902,7 +905,7 @@ caStatus casStrmClient::monitorResponse (
pDBRDD->unreference ();
errPrintf ( S_cas_noConvert, __FILE__, __LINE__,
"no conversion between event app type=%d and DBR type=%d Element count=%d",
- desc.applicationType (), msg.m_dataType, msg.m_count);
+ desc.applicationType (), msg.m_dataType, count);
return monitorFailureResponse ( guard, msg, ECA_NOCONVERT );
}
}
@@ -925,14 +928,14 @@ caStatus casStrmClient::monitorResponse (
}
int mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr (
- pPayload, msg.m_count, *pDBRDD, chan.enumStringTable() );
+ pPayload, count, *pDBRDD, chan.enumStringTable() );
if ( mapDBRStatus < 0 ) {
pDBRDD->unreference ();
return monitorFailureResponse ( guard, msg, ECA_NOCONVERT );
}
int cacStatus = caNetConvert (
- msg.m_dataType, pPayload, pPayload, true, msg.m_count );
+ msg.m_dataType, pPayload, pPayload, true, count );
if ( cacStatus != ECA_NORMAL ) {
pDBRDD->unreference ();
return this->sendErrWithEpicsStatus (
@@ -942,7 +945,7 @@ caStatus casStrmClient::monitorResponse (
//
// force string message size to be the true size
//
- if ( msg.m_dataType == DBR_STRING && msg.m_count == 1u ) {
+ if ( msg.m_dataType == DBR_STRING && count == 1u ) {
ca_uint32_t reducedPayloadSize = strlen ( static_cast < char * > ( pPayload ) ) + 1u;
this->out.commitMsg ( reducedPayloadSize );
}
@@ -1950,7 +1953,7 @@ caStatus casStrmClient::eventAddAction (
casChannelI *pciu;
{
- caStatus status = casStrmClient::verifyRequest ( pciu, true );
+ caStatus status = casStrmClient::verifyRequest ( pciu, CA_V413 ( this->minor_version_number ) );
if ( status != ECA_NORMAL ) {
if ( pciu ) {
return this->sendErr ( guard, mp,
From 1351eceead91ccae73cfb20cd627523c30db7990 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 14 Oct 2016 13:48:56 -0500
Subject: [PATCH 29/70] Clean up unused code warnings from Clang
---
src/ca/cac.cpp | 6 +++---
src/ca/iocinf.h | 7 -------
src/ca/tcpiiu.cpp | 25 -------------------------
src/cas/generic/casStrmClient.cc | 2 --
src/libCom/logClient/logClient.c | 3 ---
src/libCom/test/epicsCalcTest.cpp | 16 ----------------
6 files changed, 3 insertions(+), 56 deletions(-)
diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp
index 8a756c746..60f737ad7 100644
--- a/src/ca/cac.cpp
+++ b/src/ca/cac.cpp
@@ -149,9 +149,9 @@ cac::cac (
iiuExistenceCount ( 0u ),
cacShutdownInProgress ( false )
{
- if ( ! osiSockAttach () ) {
- throwWithLocation ( caErrorCode (ECA_INTERNAL) );
- }
+ if ( ! osiSockAttach () ) {
+ throwWithLocation ( udpiiu :: noSocket () );
+ }
try {
long status;
diff --git a/src/ca/iocinf.h b/src/ca/iocinf.h
index 8a26fdbf5..0d3b57db1 100644
--- a/src/ca/iocinf.h
+++ b/src/ca/iocinf.h
@@ -61,13 +61,6 @@ static const double CA_CONN_VERIFY_PERIOD = 30.0; /* (sec) how often to request
*/
static const unsigned contiguousMsgCountWhichTriggersFlowControl = 10u;
-class caErrorCode {
-public:
- caErrorCode ( int status ) : code ( status ) {};
-private:
- int code;
-};
-
/*
* CA internal functions
*/
diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp
index 377e3ac3c..69009c264 100644
--- a/src/ca/tcpiiu.cpp
+++ b/src/ca/tcpiiu.cpp
@@ -44,9 +44,6 @@
using namespace std;
-const unsigned mSecPerSec = 1000u;
-const unsigned uSecPerSec = 1000u * mSecPerSec;
-
tcpSendThread::tcpSendThread (
class tcpiiu & iiuIn, const char * pName,
unsigned stackSize, unsigned priority ) :
@@ -805,28 +802,6 @@ tcpiiu::tcpiiu (
}
}
-# if 0
- //
- // windows has a really strange implementation of thess options
- // and we can avoid the need for this by using pthread_kill on unix
- //
- {
- struct timeval timeout;
- double pollInterval = connectionTimeout / 8.0;
- timeout.tv_sec = static_cast < long > ( pollInterval );
- timeout.tv_usec = static_cast < long >
- ( ( pollInterval - timeout.tv_sec ) * uSecPerSec );
- // intentionally ignore status as we dont expect that all systems
- // will accept this request
- setsockopt ( this->sock, SOL_SOCKET, SO_SNDTIMEO,
- ( char * ) & timeout, sizeof ( timeout ) );
- // intentionally ignore status as we dont expect that all systems
- // will accept this request
- setsockopt ( this->sock, SOL_SOCKET, SO_RCVTIMEO,
- ( char * ) & timeout, sizeof ( timeout ) );
- }
-# endif
-
if ( isNameService() ) {
pSearchDest->setCircuit ( this );
}
diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc
index 468aa17a5..bf83a7f45 100644
--- a/src/cas/generic/casStrmClient.cc
+++ b/src/cas/generic/casStrmClient.cc
@@ -34,8 +34,6 @@ const nothrow_t nothrow ;
}
#endif
-static const caHdr nill_msg = { 0u, 0u, 0u, 0u, 0u, 0u };
-
casStrmClient::pCASMsgHandler const casStrmClient::msgHandlers[] =
{
& casStrmClient::versionAction,
diff --git a/src/libCom/logClient/logClient.c b/src/libCom/logClient/logClient.c
index adaaa7f95..4f5daaab1 100644
--- a/src/libCom/logClient/logClient.c
+++ b/src/libCom/logClient/logClient.c
@@ -34,9 +34,6 @@
#include "logClient.h"
-static const int logClientSuccess = 0;
-static const int logClientError = -1;
-
typedef struct {
char msgBuf[0x4000];
struct sockaddr_in addr;
diff --git a/src/libCom/test/epicsCalcTest.cpp b/src/libCom/test/epicsCalcTest.cpp
index 5a4d44aa7..f4d5a4660 100644
--- a/src/libCom/test/epicsCalcTest.cpp
+++ b/src/libCom/test/epicsCalcTest.cpp
@@ -198,14 +198,6 @@ static inline double MAX(double a, double b, double c, double d, double e,
double f, double g, double h, double i, double j) {
return MAX(MAX(a,b,c,d,e,f,g,h,i),j);
}
-static inline double MAX(double a, double b, double c, double d, double e,
- double f, double g, double h, double i, double j, double k) {
- return MAX(MAX(a,b,c,d,e,f,g,h,i,j),k);
-}
-static inline double MAX(double a, double b, double c, double d, double e,
- double f, double g, double h, double i, double j, double k, double l) {
- return MAX(MAX(a,b,c,d,e,f,g,h,i,j,k),l);
-}
static inline double MIN(double a) {
return a;
@@ -242,14 +234,6 @@ static inline double MIN(double a, double b, double c, double d, double e,
double f, double g, double h, double i, double j) {
return MIN(MIN(a,b,c,d,e,f,g,h,i),j);
}
-static inline double MIN(double a, double b, double c, double d, double e,
- double f, double g, double h, double i, double j, double k) {
- return MIN(MIN(a,b,c,d,e,f,g,h,i,j),k);
-}
-static inline double MIN(double a, double b, double c, double d, double e,
- double f, double g, double h, double i, double j, double k, double l) {
- return MIN(MIN(a,b,c,d,e,f,g,h,i,j,k),l);
-}
/* The test code below generates lots of spurious warnings because
* it's making sure that our operator priorities match those of C.
From 92ffe1d7267970ac392d770a071c858dc671a14f Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Tue, 18 Oct 2016 11:39:38 +0200
Subject: [PATCH 30/70] cas: fix first subscription update returning only 1
element when 0 were requested
---
src/cas/generic/caServerI.h | 9 +++++++--
src/cas/generic/casStrmClient.cc | 25 +++++++++++++++++--------
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/src/cas/generic/caServerI.h b/src/cas/generic/caServerI.h
index 6037d8c20..b45d9373a 100644
--- a/src/cas/generic/caServerI.h
+++ b/src/cas/generic/caServerI.h
@@ -40,8 +40,13 @@ class casIntfOS;
class casMonitor;
class casChannelI;
-caStatus convertContainerMemberToAtomic ( class gdd & dd,
- aitUint32 appType, aitUint32 elemCount );
+caStatus convertContainerMemberToAtomic (class gdd & dd,
+ aitUint32 appType, aitUint32 requestedCount, aitUint32 nativeCount);
+
+// Keep the old signature for backward compatibility
+inline caStatus convertContainerMemberToAtomic (class gdd & dd,
+ aitUint32 appType, aitUint32 elemCount)
+{ return convertContainerMemberToAtomic(dd, appType, elemCount, elemCount); }
class caServerI :
public caServerIO,
diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc
index b1e321120..d8d36d926 100644
--- a/src/cas/generic/casStrmClient.cc
+++ b/src/cas/generic/casStrmClient.cc
@@ -737,7 +737,9 @@ caStatus casStrmClient::readNotifyFailureResponse (
// than the destination)
//
caStatus convertContainerMemberToAtomic ( gdd & dd,
- aitUint32 appType, aitUint32 elemCount )
+ aitUint32 appType,
+ aitUint32 requestedCount,
+ aitUint32 nativeCount )
{
gdd * pVal;
if ( dd.isContainer() ) {
@@ -764,13 +766,13 @@ caStatus convertContainerMemberToAtomic ( gdd & dd,
return S_cas_badType;
}
- if ( elemCount <= 1 ) {
+ if ( nativeCount <= 1 ) {
return S_cas_success;
}
// convert to atomic
gddBounds bds;
- bds.setSize ( elemCount );
+ bds.setSize ( requestedCount );
bds.setFirst ( 0u );
pVal->setDimension ( 1u, & bds );
return S_cas_success;
@@ -780,7 +782,9 @@ caStatus convertContainerMemberToAtomic ( gdd & dd,
// createDBRDD ()
//
static caStatus createDBRDD ( unsigned dbrType,
- unsigned elemCount, gdd * & pDD )
+ unsigned requestedCount,
+ unsigned nativeCount,
+ gdd * & pDD )
{
/*
* DBR type has already been checked, but it is possible
@@ -808,7 +812,7 @@ static caStatus createDBRDD ( unsigned dbrType,
// fix the value element count
caStatus status = convertContainerMemberToAtomic (
- *pDescRet, gddAppType_value, elemCount );
+ *pDescRet, gddAppType_value, requestedCount, nativeCount );
if ( status != S_cas_success ) {
pDescRet->unreference ();
return status;
@@ -884,7 +888,10 @@ caStatus casStrmClient::monitorResponse (
gdd * pDBRDD = 0;
if ( completionStatus == S_cas_success ) {
- caStatus status = createDBRDD ( msg.m_dataType, count, pDBRDD );
+ caStatus status = createDBRDD ( msg.m_dataType,
+ count,
+ chan.getPVI().nativeCount(),
+ pDBRDD );
if ( status != S_cas_success ) {
caStatus ecaStatus;
if ( status == S_cas_badType ) {
@@ -2614,8 +2621,10 @@ caStatus casStrmClient::read ()
{
gdd * pDD = 0;
- caStatus status = createDBRDD ( pHdr->m_dataType,
- pHdr->m_count, pDD );
+ caStatus status = createDBRDD ( pHdr->m_dataType,
+ pHdr->m_count,
+ this->ctx.getChannel()->getPVI().nativeCount(),
+ pDD );
if ( status != S_cas_success ) {
return status;
}
From 994cf0ff07c7fbde81de6548255a4b077f5a42d4 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 18 Oct 2016 16:34:25 -0500
Subject: [PATCH 31/70] Add whole-program optimization control for MSVS
Introduce a new config variable OPT_WHOLE_PROGRAM for
Microsoft builds to control compiler and linker flags.
Static builds with MSVS-2010 don't work properly with
whole-program optimization enabled; this lets the static
targets be built with normal optimization enabled and
just the whole-program flags turned off.
This commit also makes the CONFIG file for Microsoft
builds more like the 3.15 version.
---
configure/os/CONFIG.win32-x86.win32-x86 | 124 +++++++++---------
...FIG_SITE.win32-x86-static.win32-x86-static | 8 ++
...SITE.windows-x64-static.windows-x64-static | 8 ++
3 files changed, 76 insertions(+), 64 deletions(-)
create mode 100644 configure/os/CONFIG_SITE.win32-x86-static.win32-x86-static
create mode 100644 configure/os/CONFIG_SITE.windows-x64-static.windows-x64-static
diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86
index d6592dced..96cde4cf4 100644
--- a/configure/os/CONFIG.win32-x86.win32-x86
+++ b/configure/os/CONFIG.win32-x86.win32-x86
@@ -8,6 +8,8 @@
VALID_BUILDS = Host Ioc
+OPT_WHOLE_PROGRAM = YES
+
# convert UNIX path to native path
PATH_FILTER = $(subst /,\\,$(1))
@@ -35,34 +37,30 @@ HDEPENDS_METHOD = CMD
# Compiler flags for C files (C++ is below)
#
-# /W display warnings at level d
-# /W4 is for maximum (lint type) warnings
-# /W3 is for production quality warnings
-# /W2 displays significant warnings
-# /W1 is the default and shows severe warnings only
-# /w Set warning C to be shown at level
-WARN_CFLAGS_YES = /W3
-WARN_CFLAGS_NO = /W1
+# -W display warnings at level d
+# -W4 is for maximum (lint type) warnings
+# -W3 is for production quality warnings
+# -W2 displays significant warnings
+# -W1 is the default and shows severe warnings only
+# -w Set warning C to be shown at level
+WARN_CFLAGS_YES = -W3
+WARN_CFLAGS_NO = -W1
#
-# /Ox maximum optimizations
-# /MD use MSVCRT (run-time as DLL, multi-thread support)
-# /GL whole program optimization
-# /Zi generate program database for debugging information
-OPT_CFLAGS_YES = /Ox /GL
+# -Ox maximum optimizations
+# -GL whole program optimization
+# -Oy- re-enable creation of frame pointers
+OPT_CFLAGS_YES_YES = -Ox -GL -Oy-
+OPT_CFLAGS_YES_NO = -Ox -Oy-
+OPT_CFLAGS_YES = $(OPT_CFLAGS_YES_$(OPT_WHOLE_PROGRAM))
#
-# /Zi generate program database for debugging information
-# /Z7 include debugging info in object files
-# /Fr create source browser file
-# /GZ catch bugs occurring only in optimized code
-# /D_CRTDBG_MAP_ALLOC
-# /RTCsu catch bugs occuring only inoptimized code
-# /DEPICS_FREELIST_DEBUG good for detecting mem mrg bugs
-OPT_CFLAGS_NO = /Zi /RTCsu
+# -Zi generate program database for debugging information
+# -RTCsu enable run-time error checks
+OPT_CFLAGS_NO = -Zi -RTCsu
# specify object file name and location
-OBJ_CFLAG = /Fo
+OBJ_CFLAG = -Fo
#
# the following options are required when
@@ -87,53 +85,44 @@ CPP = cl /nologo /C /E
# Configure OS vendor C++ compiler
#
-# __STDC__=0 is a real great idea of Jeff that gives us both:
+# __STDC__=0 gives us both:
# 1) define STDC for code (pretend ANSI conformance)
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
# because MS uses: if __STDC__ ... disable many nice things
#
-# Use of /Za would dissable DLL import/export keywords which
-# include/excludes using architecture neutral macros
-#
-# /EHsc - generate code for exceptions
-# /GR - generate code for run time type identification
+# -EHsc - generate code for exceptions
+# -GR - generate code for run time type identification
#
-CCC = cl /nologo /EHsc /GR
-CODE_CPPFLAGS += /nologo /D__STDC__=0
-CODE_CPPFLAGS += /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
+CCC = cl -EHsc -GR
+CODE_CPPFLAGS += -nologo -D__STDC__=0
+CODE_CPPFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
# Compiler flags for C++ files
#
-# /W display warnings at level d
-# /W4 is for maximum (lint type) warnings
-# /W3 is for production quality warnings
-# /W2 displays significant warnings
-# /W1 is the default and shows severe warnings only
-# /w Set warning C to be shown at level
-# /w44355 "'this' used in the base initializer list"
-# /w44344 "behavior change: use of explicit template arguments results in ..."
-WARN_CXXFLAGS_YES = /W3 /w44355 /w44344
-WARN_CXXFLAGS_NO = /W1
+# -W use warning level N
+# (maximum lint level warnings at level 4)
+# -w44355 set "'this' used in the base initializer list" to be level 4
+# -w44344 "behavior change: use of explicit template arguments results in ..."
+WARN_CXXFLAGS_YES = -W3 -w44355 -w44344
+WARN_CXXFLAGS_NO = -W1
#
-# /Ox maximum optimizations
-# /GL whole program optimization
-# /Zi generate program database for debugging information
-OPT_CXXFLAGS_YES = /Ox /GL
+# -Ox maximum optimizations
+# -GL whole program optimization
+# -Oy- re-enable creation of frame pointers
+OPT_CXXFLAGS_YES_YES = -Ox -GL -Oy-
+OPT_CXXFLAGS_YES_NO = -Ox -Oy-
+OPT_CXXFLAGS_YES = $(OPT_CXXFLAGS_YES_$(OPT_WHOLE_PROGRAM))
#
-# /Zi generate program database for debugging information
-# /Z7 include debugging info in object files
-# /Fr create source browser file
-# /D_CRTDBG_MAP_ALLOC
-# /RTCsu catch bugs occurring only in optimized code
-# /DEPICS_FREELIST_DEBUG good for detecting mem mrg bugs
-OPT_CXXFLAGS_NO = /RTCsu /Zi
+# -Zi generate program database for debugging information
+# -RTCsu enable run-time error checks
+OPT_CXXFLAGS_NO = -RTCsu -Zi
# specify object file name and location
-OBJ_CXXFLAG = /Fo
+OBJ_CXXFLAG = -Fo
#
# the following options are required when
@@ -152,14 +141,20 @@ STATIC_LDLIBS_NO=
STATIC_LDFLAGS=
RANLIB=
-# add /profile here to run the ms profiler
-# /LTCG - whole program optimization
-# /fixed:no good for programs such as purify and quantify
-# /debug good for programs such as purify and quantify
-LINK_OPT_FLAGS_YES = /LTCG /incremental:no /opt:ref /release $(PROD_VERSION:%=/version:%)
-LINK_OPT_FLAGS_NO = /debug /incremental:no /fixed:no
+# add -profile here to run the ms profiler
+# -LTCG whole program optimization
+# -incremental:no full linking
+# -fixed:no generate relocatable code
+# -version:. - only 2 components allowed, 0-65535 each
+# -debug generate debugging info
+LINK_OPT_FLAGS_WHOLE_YES = -LTCG
+LINK_OPT_FLAGS_YES = $(LINK_OPT_FLAGS_WHOLE_$(OPT_WHOLE_PROGRAM))
+LINK_OPT_FLAGS_YES += -incremental:no -opt:ref
+LINK_OPT_FLAGS_YES += -release $(PROD_VERSION:%=-version:%)
+LINK_OPT_FLAGS_NO = -debug -incremental:no -fixed:no
OPT_LDFLAGS = $(LINK_OPT_FLAGS_$(HOST_OPT))
-LIB_OPT_FLAGS_YES = /LTCG
+
+LIB_OPT_FLAGS_YES = $(LINK_OPT_FLAGS_WHOLE_$(OPT_WHOLE_PROGRAM))
LIB_OPT_LDFLAGS = $(LIB_OPT_FLAGS_$(HOST_OPT))
ARCH_DEP_CFLAGS=
@@ -288,8 +283,8 @@ SHRLIB_LDLIBS += $(addsuffix .lib, \
#--------------------------------------------------
# Linker definition
-LINK.cpp = $(WINLINK) -nologo $(STATIC_LDFLAGS) $(LDFLAGS) $(PROD_LDFLAGS) -out:$@ \
- $(call PATH_FILTER, $(PROD_LD_OBJS) $(PROD_LD_RESS) $(PROD_LDLIBS))
+LINK.cpp = $(WINLINK) -nologo $(STATIC_LDFLAGS) $(LDFLAGS) $(PROD_LDFLAGS) \
+ -out:$@ $(call PATH_FILTER, $(PROD_LD_OBJS) $(PROD_LD_RESS) $(PROD_LDLIBS))
#--------------------------------------------------
# UseManifestTool.pl checks MS Visual c++ compiler version number to
@@ -297,9 +292,10 @@ LINK.cpp = $(WINLINK) -nologo $(STATIC_LDFLAGS) $(LDFLAGS) $(PROD_LDFLAGS) -out:
# linker created .manifest file into a library or product target.
# useManifestTool.pl returns 0(don't use) or 1(use).
#
-MT_DLL_COMMAND1 = mt.exe /manifest $@.manifest "/outputresource:$@;\#2"
+MT.exe = mt.exe -nologo -manifest $@.manifest
+MT_DLL_COMMAND1 = $(MT.exe) "-outputresource:$@;\#2"
MT_EXE_COMMAND_YES =
-MT_EXE_COMMAND_NO = mt.exe /manifest $@.manifest "/outputresource:$@;\#1"
+MT_EXE_COMMAND_NO = $(MT.exe) "-outputresource:$@;\#1"
MT_EXE_COMMAND1 = $(MT_EXE_COMMAND_$(STATIC_BUILD))
MT_DLL_COMMAND = $(MT_DLL_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl))
MT_EXE_COMMAND = $(MT_EXE_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl))
diff --git a/configure/os/CONFIG_SITE.win32-x86-static.win32-x86-static b/configure/os/CONFIG_SITE.win32-x86-static.win32-x86-static
new file mode 100644
index 000000000..789a0ceeb
--- /dev/null
+++ b/configure/os/CONFIG_SITE.win32-x86-static.win32-x86-static
@@ -0,0 +1,8 @@
+# CONFIG_SITE.win32-x86-static.win32-x86-static
+#
+# Site-specific settings for the win32-x86-static target
+
+# Whole-program optimization doesn't work with Visual Studio 2010 when
+# building static binaries. Newer versions of Visual Studio than 2010
+# may work though, comment out or set this to YES to try.
+OPT_WHOLE_PROGRAM = NO
diff --git a/configure/os/CONFIG_SITE.windows-x64-static.windows-x64-static b/configure/os/CONFIG_SITE.windows-x64-static.windows-x64-static
new file mode 100644
index 000000000..23e489b1c
--- /dev/null
+++ b/configure/os/CONFIG_SITE.windows-x64-static.windows-x64-static
@@ -0,0 +1,8 @@
+# CONFIG_SITE.windows-x64-static.windows-x64-static
+#
+# Site-specific settings for the windows-x64-static target
+
+# Whole-program optimization doesn't work with Visual Studio 2010 when
+# building static binaries. Newer versions of Visual Studio than 2010
+# may work though, comment out or set this to YES to try.
+OPT_WHOLE_PROGRAM = NO
From 5d5cc1029ef9d181db23ca3b0053656eda8f73be Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Wed, 19 Oct 2016 11:57:13 +0200
Subject: [PATCH 32/70] gdd: make put() write full array if requested size=0
---
src/gdd/gdd.cc | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/gdd/gdd.cc b/src/gdd/gdd.cc
index 1a84808c6..438986ad1 100644
--- a/src/gdd/gdd.cc
+++ b/src/gdd/gdd.cc
@@ -1355,11 +1355,14 @@ gddStatus gdd::put ( const gdd * dd )
}
aitUint32 srcAvailSize = srcElemCount - unusedSrcBelow;
- if ( srcAvailSize > this->getBounds()->size() ) {
- srcCopySize = this->getBounds()->size();
- }
- else {
- srcCopySize = srcAvailSize;
+ {
+ aitUint32 destSize = this->getBounds()->size();
+ if ( destSize > 0 && srcAvailSize > destSize ) {
+ srcCopySize = destSize;
+ }
+ else {
+ srcCopySize = srcAvailSize;
+ }
}
if ( dataVoid() == NULL )
From ac6b8bfcc77d3077f2013b0b83874f910b183b9a Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Wed, 19 Oct 2016 14:22:25 +0200
Subject: [PATCH 33/70] templates: make caServerApp use variable size vectors
---
src/makeBaseApp/top/caServerApp/exPV.cc | 2 +-
src/makeBaseApp/top/caServerApp/exServer.h | 35 +++++++++++------
src/makeBaseApp/top/caServerApp/exVectorPV.cc | 39 ++++++++++---------
3 files changed, 46 insertions(+), 30 deletions(-)
diff --git a/src/makeBaseApp/top/caServerApp/exPV.cc b/src/makeBaseApp/top/caServerApp/exPV.cc
index bc88b15bb..d35a4dbfa 100644
--- a/src/makeBaseApp/top/caServerApp/exPV.cc
+++ b/src/makeBaseApp/top/caServerApp/exPV.cc
@@ -42,7 +42,7 @@ exPV::exPV ( exServer & casIn, pvInfo & setup,
//
// no dataless PV allowed
//
- assert (this->info.getElementCount()>=1u);
+ assert (this->info.getCapacity()>=1u);
//
// start a very slow background scan
diff --git a/src/makeBaseApp/top/caServerApp/exServer.h b/src/makeBaseApp/top/caServerApp/exServer.h
index 5fb6adaf7..8336fda1a 100644
--- a/src/makeBaseApp/top/caServerApp/exServer.h
+++ b/src/makeBaseApp/top/caServerApp/exServer.h
@@ -76,8 +76,10 @@ public:
double getLopr () const;
aitEnum getType () const;
excasIoType getIOType () const;
- unsigned getElementCount () const;
- void unlinkPV ();
+ unsigned getCapacity () const;
+ unsigned getElementCount () const;
+ void setElementCount (unsigned);
+ void unlinkPV ();
exPV *createPV ( exServer & exCAS, bool preCreateFlag,
bool scanOn, double asyncDelay );
void deletePV ();
@@ -88,7 +90,8 @@ private:
const double lopr;
aitEnum type;
const excasIoType ioType;
- const unsigned elementCount;
+ const unsigned capacity;
+ unsigned elementCount;
exPV * pPV;
pvInfo & operator = ( const pvInfo & );
};
@@ -441,8 +444,8 @@ inline pvInfo::pvInfo ( double scanPeriodIn, const char *pNameIn,
scanPeriod ( scanPeriodIn ), pName ( pNameIn ),
hopr ( hoprIn ), lopr ( loprIn ), type ( typeIn ),
- ioType ( ioTypeIn ), elementCount ( countIn ),
- pPV ( 0 )
+ ioType ( ioTypeIn ), capacity ( countIn ),
+ elementCount ( 0 ), pPV ( 0 )
{
}
@@ -454,8 +457,8 @@ inline pvInfo::pvInfo ( const pvInfo & copyIn ) :
scanPeriod ( copyIn.scanPeriod ), pName ( copyIn.pName ),
hopr ( copyIn.hopr ), lopr ( copyIn.lopr ), type ( copyIn.type ),
- ioType ( copyIn.ioType ), elementCount ( copyIn.elementCount ),
- pPV ( copyIn.pPV )
+ ioType ( copyIn.ioType ), capacity ( copyIn.capacity ),
+ elementCount ( copyIn.elementCount ), pPV ( copyIn.pPV )
{
}
@@ -509,12 +512,22 @@ inline excasIoType pvInfo::getIOType () const
return this->ioType;
}
-inline unsigned pvInfo::getElementCount () const
-{
- return this->elementCount;
+inline unsigned pvInfo::getCapacity () const
+{
+ return this->capacity;
}
-inline void pvInfo::unlinkPV ()
+inline unsigned pvInfo::getElementCount () const
+{
+ return this->elementCount;
+}
+
+inline void pvInfo::setElementCount (unsigned newCount)
+{
+ this->elementCount = newCount;
+}
+
+inline void pvInfo::unlinkPV ()
{
this->pPV = NULL;
}
diff --git a/src/makeBaseApp/top/caServerApp/exVectorPV.cc b/src/makeBaseApp/top/caServerApp/exVectorPV.cc
index da357831f..3308f8b20 100644
--- a/src/makeBaseApp/top/caServerApp/exVectorPV.cc
+++ b/src/makeBaseApp/top/caServerApp/exVectorPV.cc
@@ -48,7 +48,7 @@ unsigned exVectorPV::maxDimension() const
aitIndex exVectorPV::maxBound (unsigned dimension) const // X aCC 361
{
if (dimension==0u) {
- return this->info.getElementCount();
+ return this->info.getCapacity();
}
else {
return 0u;
@@ -79,7 +79,7 @@ void exVectorPV::scan()
this->currentTime = epicsTime::getCurrent();
pDD = new gddAtomic (gddAppType_value, aitEnumFloat64,
- 1u, this->info.getElementCount());
+ 1u, this->info.getCapacity());
if ( ! pDD.valid () ) {
return;
}
@@ -93,7 +93,7 @@ void exVectorPV::scan()
//
// allocate array buffer
//
- pF = new aitFloat32 [this->info.getElementCount()];
+ pF = new aitFloat32 [this->info.getCapacity()];
if (!pF) {
return;
}
@@ -118,13 +118,13 @@ void exVectorPV::scan()
if ( this->pValue.valid () ) {
if (this->pValue->dimension()==1u) {
const gddBounds *pB = this->pValue->getBounds();
- if (pB[0u].size()==this->info.getElementCount()) {
+ if (pB[0u].size()==this->info.getCapacity()) {
pCF = *this->pValue;
}
}
}
- pFE = &pF[this->info.getElementCount()];
+ pFE = &pF[this->info.getCapacity()];
while (pFsetTimeStamp ( & gddts );
status = this->update ( *pDD );
+ this->info.setElementCount(this->info.getCapacity());
+
if ( status != S_casApp_success ) {
errMessage (status, "vector scan update failed\n");
}
@@ -166,7 +168,7 @@ void exVectorPV::scan()
//
caStatus exVectorPV::updateValue ( const gdd & value )
{
-
+ aitUint32 newSize = 0;
//
// Check bounds of incoming request
// (and see if we are replacing all elements -
@@ -180,10 +182,11 @@ caStatus exVectorPV::updateValue ( const gdd & value )
return S_casApp_badDimension;
}
const gddBounds* pb = value.getBounds ();
+ newSize = pb[0u].size();
if ( pb[0u].first() != 0u ) {
return S_casApp_outOfBounds;
}
- else if ( pb[0u].size() > this->info.getElementCount() ) {
+ else if ( newSize > this->info.getCapacity() ) {
return S_casApp_outOfBounds;
}
}
@@ -193,14 +196,14 @@ caStatus exVectorPV::updateValue ( const gdd & value )
//
return S_casApp_outOfBounds;
}
-
+
//
// Create a new array data descriptor
// (so that old values that may be referenced on the
// event queue are not replaced)
//
- smartGDDPointer pNewValue ( new gddAtomic ( gddAppType_value, aitEnumFloat64,
- 1u, this->info.getElementCount() ) );
+ smartGDDPointer pNewValue ( new gddAtomic ( gddAppType_value, aitEnumFloat64,
+ 1u, newSize ) );
if ( ! pNewValue.valid() ) {
return S_casApp_noMemory;
}
@@ -211,21 +214,20 @@ caStatus exVectorPV::updateValue ( const gdd & value )
//
gddStatus gdds = pNewValue->unreference( );
assert ( ! gdds );
-
+
//
// allocate array buffer
//
- aitFloat64 * pF = new aitFloat64 [this->info.getElementCount()];
+ aitFloat64 * pF = new aitFloat64 [newSize];
if (!pF) {
return S_casApp_noMemory;
}
-
+
//
// Install (and initialize) array buffer
// if no old values exist
//
- unsigned count = this->info.getElementCount();
- for ( unsigned i = 0u; i < count; i++ ) {
+ for ( unsigned i = 0u; i < newSize; i++ ) {
pF[i] = 0.0f;
}
@@ -240,7 +242,7 @@ caStatus exVectorPV::updateValue ( const gdd & value )
// (do this before we increment pF)
//
pNewValue->putRef ( pF, pDest );
-
+
//
// copy in the values that they are writing
//
@@ -248,9 +250,10 @@ caStatus exVectorPV::updateValue ( const gdd & value )
if ( gdds ) {
return S_cas_noConvert;
}
-
+
this->pValue = pNewValue;
-
+ this->info.setElementCount(newSize);
+
return S_casApp_success;
}
From ba555ee49675d9f469f14e0ffd8effecd97b2513 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 20 Oct 2016 12:23:06 -0500
Subject: [PATCH 34/70] Fix Whole Program opt settings (windows only)
---
...tic.win32-x86-static => CONFIG_SITE.Common.win32-x86-static} | 2 +-
...windows-x64-static => CONFIG_SITE.Common.windows-x64-static} | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
rename configure/os/{CONFIG_SITE.win32-x86-static.win32-x86-static => CONFIG_SITE.Common.win32-x86-static} (85%)
rename configure/os/{CONFIG_SITE.windows-x64-static.windows-x64-static => CONFIG_SITE.Common.windows-x64-static} (84%)
diff --git a/configure/os/CONFIG_SITE.win32-x86-static.win32-x86-static b/configure/os/CONFIG_SITE.Common.win32-x86-static
similarity index 85%
rename from configure/os/CONFIG_SITE.win32-x86-static.win32-x86-static
rename to configure/os/CONFIG_SITE.Common.win32-x86-static
index 789a0ceeb..de4e61760 100644
--- a/configure/os/CONFIG_SITE.win32-x86-static.win32-x86-static
+++ b/configure/os/CONFIG_SITE.Common.win32-x86-static
@@ -1,4 +1,4 @@
-# CONFIG_SITE.win32-x86-static.win32-x86-static
+# CONFIG_SITE.Common.win32-x86-static
#
# Site-specific settings for the win32-x86-static target
diff --git a/configure/os/CONFIG_SITE.windows-x64-static.windows-x64-static b/configure/os/CONFIG_SITE.Common.windows-x64-static
similarity index 84%
rename from configure/os/CONFIG_SITE.windows-x64-static.windows-x64-static
rename to configure/os/CONFIG_SITE.Common.windows-x64-static
index 23e489b1c..5db619b11 100644
--- a/configure/os/CONFIG_SITE.windows-x64-static.windows-x64-static
+++ b/configure/os/CONFIG_SITE.Common.windows-x64-static
@@ -1,4 +1,4 @@
-# CONFIG_SITE.windows-x64-static.windows-x64-static
+# CONFIG_SITE.Common.windows-x64-static
#
# Site-specific settings for the windows-x64-static target
From 3e3b691518a0cbcbe08cfe3829126ff5ddca4420 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 20 Oct 2016 18:03:03 -0500
Subject: [PATCH 35/70] Update version to 3.14.12.6-pre1
---
configure/CONFIG_BASE_VERSION | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 6449b2940..0330c8c2e 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -4,7 +4,7 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
-# in the file LICENSE that is included with this distribution.
+# in the file LICENSE that is included with this distribution.
#*************************************************************************
#
# EPICS Version information
@@ -28,11 +28,11 @@ EPICS_MODIFICATION = 12
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included if zero
-EPICS_PATCH_LEVEL = 5
+EPICS_PATCH_LEVEL = 6
# This will end in -DEV between official releases
-EPICS_DEV_SNAPSHOT=-DEV
-#EPICS_DEV_SNAPSHOT=-pre1
+#EPICS_DEV_SNAPSHOT=-DEV
+EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
From 178a8a835a9f81ab21a31526504d2187023d980f Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 20 Oct 2016 18:03:50 -0500
Subject: [PATCH 36/70] Update version to 3.14.12.6-pre1-DEV
---
configure/CONFIG_BASE_VERSION | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 0330c8c2e..43b79f233 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -32,8 +32,8 @@ EPICS_PATCH_LEVEL = 6
# This will end in -DEV between official releases
#EPICS_DEV_SNAPSHOT=-DEV
-EPICS_DEV_SNAPSHOT=-pre1
-#EPICS_DEV_SNAPSHOT=-pre1-DEV
+#EPICS_DEV_SNAPSHOT=-pre1
+EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
#EPICS_DEV_SNAPSHOT=-rc1
From 14819ef1ec753955313aa24510c173ce6989281f Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 21 Oct 2016 12:07:26 -0500
Subject: [PATCH 37/70] Update version numbers in docs
---
documentation/KnownProblems.html | 29 +++++++++--------------------
documentation/README.1st | 2 +-
documentation/README.html | 2 +-
documentation/ReleaseChecklist.html | 24 ++++++++++++------------
4 files changed, 23 insertions(+), 34 deletions(-)
diff --git a/documentation/KnownProblems.html b/documentation/KnownProblems.html
index 4c33c04c1..ab10855cc 100644
--- a/documentation/KnownProblems.html
+++ b/documentation/KnownProblems.html
@@ -4,17 +4,17 @@
- Known Problems in R3.15.3
+ Known Problems in R3.15.5
-EPICS Base R3.15.3: Known Problems
+EPICS Base R3.15.5: Known Problems
Any patch files linked below should be applied at the root of the
-base-3.15.3 tree. Download them, then use the GNU Patch program as
+base-3.15.5 tree. Download them, then use the GNU Patch program as
follows:
-% cd /path/to/base-3.15.3
+% cd /path/to/base-3.15.5
% patch -p0 < /path/to/file.patch
The following significant problems have been reported with this
@@ -22,22 +22,11 @@ version of EPICS Base:
- - See LaunchPad bug
- #1466129:
- The feature that allows an IOC to bind to a single network interface is not
- working correctly. The bug mentioned above contains a patch that has been
- tested on Linux-64, a complete fix is expected for 3.15.4. Note that Windows
- systems are not affected by this bug.
-
- - Parallel builds ("make -j") on native Windows are not working properly.
- Builds tend to hang (saturating one core); interrupting and running make
- again usually finishes the build. Limiting the number of parallel jobs using
- something like "make -j8" also helps prevent this problem. Sequential builds
- always work and are recommended for automated build environments.
-
- - 64-bit Windows builds of the CAS library may not work with some compilers.
- The code in src/legacy/gdd is currently incompatible with the LLP64
- model that Windows uses for its 64-bit ABI.
+ - Parallel builds ("make -j") of Windows DLL targets don't work, because the
+ build rules don't contain all the necessary dependencies. This problem has
+ been fixed in the 3.15 series build rules, but will not be addressed in the
+ 3.14 branch. Sequential builds always work and are recommended for automated
+ build environments.
diff --git a/documentation/README.1st b/documentation/README.1st
index e82263d67..8349d445c 100644
--- a/documentation/README.1st
+++ b/documentation/README.1st
@@ -1,6 +1,6 @@
Installation Instructions
- EPICS Base Release 3.15.3
+ EPICS Base Release 3.15.5
--------------------------------------------------------------------------
diff --git a/documentation/README.html b/documentation/README.html
index 56aa27528..eef83ed58 100644
--- a/documentation/README.html
+++ b/documentation/README.html
@@ -9,7 +9,7 @@
Installation Instructions
-EPICS Base Release 3.15.3
+EPICS Base Release 3.15.5
Table of Contents
diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html
index 085b22047..49d936ca2 100644
--- a/documentation/ReleaseChecklist.html
+++ b/documentation/ReleaseChecklist.html
@@ -135,17 +135,17 @@ relevent roles unless the Release Manager designates otherwise:
Tag the module in Bazaar, using these tag conventions:
-
- R3.15.3-pren
+ R3.15.5-pren
— pre-release tag
-
- R3.15.3-rcn
+ R3.15.5-rcn
— release candidate tag, note the rc is now
lower-case
cd ~/base/mirror-3.15
- bzr tag R3.15.3-rcn
+ bzr tag R3.15.5-rcn
|
@@ -156,10 +156,10 @@ relevent roles unless the Release Manager designates otherwise:
generates a gzipped tarfile directly from the repository:
cd ~/base
- bzr export --keywords=publish
- --root=base-3.15.3-rcn
- -r tag:R3.15.3-rcn
- base-3.15.3-rcn.tar.gz
+ bzr export
+ --root=base-3.15.5-rcn
+ -r tag:R3.15.5-rcn
+ base-3.15.5-rcn.tar.gz
mirror-3.15
This requires that the Bazaar keywords plugin is installed and
@@ -274,7 +274,7 @@ relevent roles unless the Release Manager designates otherwise:
Tag the module in Bazaar:
cd ~/base/mirror-3.15
- bzr tag R3.15.3
+ bzr tag R3.15.5
|
@@ -285,10 +285,10 @@ relevent roles unless the Release Manager designates otherwise:
generates a gzipped tarfile directly from the repository:
cd ~/base
- bzr export --keywords=publish
- --root=base-3.15.3
- -r tag:R3.15.3
- base-3.15.3.tar.gz
+ bzr export
+ --root=base-3.15.5
+ -r tag:R3.15.5
+ base-3.15.5.tar.gz
mirror-3.15
This requires that the Bazaar keywords plugin is installed and
From 9ea2ac7bc1f1e14b5aa4a16be2a664dfe467c00e Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 21 Oct 2016 12:15:09 -0500
Subject: [PATCH 38/70] Update version to 3.15.5-pre1
---
configure/CONFIG_BASE_VERSION | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index f28cbe40b..92b030648 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -27,15 +27,15 @@ EPICS_VERSION = 3
EPICS_REVISION = 15
# EPICS_MODIFICATION must be a number >=0 and <256
-EPICS_MODIFICATION = 4
+EPICS_MODIFICATION = 5
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included if zero
EPICS_PATCH_LEVEL = 0
# This will end in -DEV between official releases
-EPICS_DEV_SNAPSHOT=-DEV
-#EPICS_DEV_SNAPSHOT=-pre1
+#EPICS_DEV_SNAPSHOT=-DEV
+EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
From 33025641fc6e0d2981dbd6a8f5740111736e9b36 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 21 Oct 2016 12:16:25 -0500
Subject: [PATCH 39/70] Update version to 3.15.5-pre1-DEV
---
configure/CONFIG_BASE_VERSION | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 92b030648..890b5619c 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -23,10 +23,10 @@ BASE_3_15 = YES
# EPICS_VERSION must be a number >0 and <256
EPICS_VERSION = 3
-# EPICS_REVISION must be a number >=0 and <256
+# EPICS_REVISION must be a number >=0 and <256
EPICS_REVISION = 15
-# EPICS_MODIFICATION must be a number >=0 and <256
+# EPICS_MODIFICATION must be a number >=0 and <256
EPICS_MODIFICATION = 5
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
@@ -35,8 +35,8 @@ EPICS_PATCH_LEVEL = 0
# This will end in -DEV between official releases
#EPICS_DEV_SNAPSHOT=-DEV
-EPICS_DEV_SNAPSHOT=-pre1
-#EPICS_DEV_SNAPSHOT=-pre1-DEV
+#EPICS_DEV_SNAPSHOT=-pre1
+EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
#EPICS_DEV_SNAPSHOT=-rc1
From e2c897bb54bd0f8c1ddf848b772d3548ed3a203f Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 21 Oct 2016 14:43:16 -0500
Subject: [PATCH 40/70] Corrections/updates to release documentation
---
documentation/KnownProblems.html | 6 +-----
documentation/ReleaseChecklist.html | 15 ++++++++++-----
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/documentation/KnownProblems.html b/documentation/KnownProblems.html
index ab10855cc..5dfc280db 100644
--- a/documentation/KnownProblems.html
+++ b/documentation/KnownProblems.html
@@ -22,11 +22,7 @@ version of EPICS Base:
- - Parallel builds ("make -j") of Windows DLL targets don't work, because the
- build rules don't contain all the necessary dependencies. This problem has
- been fixed in the 3.15 series build rules, but will not be addressed in the
- 3.14 branch. Sequential builds always work and are recommended for automated
- build environments.
+ - None known as yet.
diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html
index 49d936ca2..77917b99e 100644
--- a/documentation/ReleaseChecklist.html
+++ b/documentation/ReleaseChecklist.html
@@ -162,8 +162,10 @@ relevent roles unless the Release Manager designates otherwise:
base-3.15.5-rcn.tar.gz
mirror-3.15
- This requires that the Bazaar keywords plugin is installed and
- configured properly.
+ Create a GPG signature file of the tarfile as follows:
+
+ gpg --armor --sign --detach-sig base-3.15.5-rcn.tar.gz
+
@@ -291,8 +293,10 @@ relevent roles unless the Release Manager designates otherwise:
base-3.15.5.tar.gz
mirror-3.15
- This requires that the Bazaar keywords plugin is installed and
- configured properly.
+ Create a GPG signature file of the tarfile as follows:
+
+ gpg --armor --sign --detach-sig base-3.15.5.tar.gz
+
@@ -308,7 +312,8 @@ relevent roles unless the Release Manager designates otherwise:
| |
Website Manager |
If necessary recreate the tarfile following the instructions above.
- Copy the tar file to the Base download area of the website |
+ Copy the tar file and its .asc signature file to the Base
+ download area of the website.
| |
From 435ac7b086534144691e21a0a2de02d51606aa89 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Sat, 29 Oct 2016 15:49:13 -0500
Subject: [PATCH 41/70] Release note updates
---
documentation/RELEASE_NOTES.html | 33 ++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 43d2a9d62..dc0fdcdb3 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -13,6 +13,39 @@
+Launchpad Bug-fixes
+
+In addition to the more detailed change descriptions below, the following
+Launchpad bugs have also been fixed in this release:
+
+
+ -
+ #1440186 Crash due to a too small buffer being provided in
+ dbContextReadNotifyCache
+ -
+ #1479316 Some data races found using Helgrind
+ -
+ #1495833 biRecord prompt groups are nonsensical
+ -
+ #1606848 WSAIoctl SIO_GET_INTERFACE_LIST failed in Windows
+
+
+Whole-Program Optimization for MS Visual Studio Targets
+
+When using the Microsoft compilers a new build system variable is provided
+that controls whether whole program optimization is used or not. For static
+builds using Visual Studio 2010 this optimization must be disabled. This is
+controlled in the files configure/os/CONFIG_SITE.Common.windows-x64-static and
+configure/os/CONFIG_SITE.Common.win32-x86-static by setting the variable
+OPT_WHOLE_PROGRAM = NO to override the default value
+YES that would otherwise be used.
+
+Note that enabling this optimization slows down the build process. It is not
+possible to selectively disable this optimization, when building a particular
+module say; Microsoft's linker will restart itself automatically with the
+-LTCG flag set and display a warning if it is asked to link any object
+files that were compiled with the -GL flag.
+
Add dynamic (variable length) array support to PCAS
Dynamic array sizing support was added to the IOC server (RSRV) in the
From 628382d72d5ab73374fd55e14cfc221998b0efff Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Mon, 31 Oct 2016 13:48:06 +0100
Subject: [PATCH 42/70] Update version to 3.15.5-rc1
---
configure/CONFIG_BASE_VERSION | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 890b5619c..399a11f95 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -36,10 +36,10 @@ EPICS_PATCH_LEVEL = 0
# This will end in -DEV between official releases
#EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
-EPICS_DEV_SNAPSHOT=-pre1-DEV
+#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
-#EPICS_DEV_SNAPSHOT=-rc1
+EPICS_DEV_SNAPSHOT=-rc1
#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
From a36443557b8bbd1c5535280c8da2f4aed6184297 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 31 Oct 2016 17:03:35 -0500
Subject: [PATCH 43/70] Set version to 3.14.12.6-rc1
---
configure/CONFIG_BASE_VERSION | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 43b79f233..00ae748d8 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -26,17 +26,17 @@ EPICS_REVISION = 14
# EPICS_MODIFICATION must be a number >=0 and <256
EPICS_MODIFICATION = 12
-# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
+# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included if zero
EPICS_PATCH_LEVEL = 6
# This will end in -DEV between official releases
#EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
-EPICS_DEV_SNAPSHOT=-pre1-DEV
+#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
-#EPICS_DEV_SNAPSHOT=-rc1
+EPICS_DEV_SNAPSHOT=-rc1
#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
From 67daaaa9b7518a465b45ea58e4ba0b7db305395c Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 31 Oct 2016 17:06:19 -0500
Subject: [PATCH 44/70] Set snapshot to -rc1-DEV
---
configure/CONFIG_BASE_VERSION | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 00ae748d8..decbf9280 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -36,8 +36,8 @@ EPICS_PATCH_LEVEL = 6
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
-EPICS_DEV_SNAPSHOT=-rc1
-#EPICS_DEV_SNAPSHOT=-rc1-DEV
+#EPICS_DEV_SNAPSHOT=-rc1
+EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
#EPICS_DEV_SNAPSHOT=
From 3e0ddbb54284684e1d799f7c396b826968979b5c Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 31 Oct 2016 18:06:50 -0500
Subject: [PATCH 45/70] Set snapshot to -rc1-DEV
---
configure/CONFIG_BASE_VERSION | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 399a11f95..d87d48baf 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -39,8 +39,8 @@ EPICS_PATCH_LEVEL = 0
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
-EPICS_DEV_SNAPSHOT=-rc1
-#EPICS_DEV_SNAPSHOT=-rc1-DEV
+#EPICS_DEV_SNAPSHOT=-rc1
+EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
#EPICS_DEV_SNAPSHOT=
From aa6e976f92d144b5143cf267d8b2781d3ec8b62b Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 4 Nov 2016 17:18:14 -0500
Subject: [PATCH 46/70] Add .local includes to makeBaseApp templates
---
src/makeBaseApp/top/configure/CONFIG_SITE | 7 +++++++
src/makeBaseApp/top/configure/RELEASE | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/src/makeBaseApp/top/configure/CONFIG_SITE b/src/makeBaseApp/top/configure/CONFIG_SITE
index 92156d971..9b443bfbe 100644
--- a/src/makeBaseApp/top/configure/CONFIG_SITE
+++ b/src/makeBaseApp/top/configure/CONFIG_SITE
@@ -29,3 +29,10 @@ CHECK_RELEASE = YES
# to the install location. This may be needed to boot from
# a Microsoft FTP server say, or on some NFS configurations.
#IOCS_APPL_TOP =
+
+# These allow developers to override the CONFIG_SITE variable
+# settings without having to modify the configure/CONFIG_SITE
+# file itself.
+-include $(TOP)/../CONFIG_SITE.local
+-include $(TOP)/configure/CONFIG_SITE.local
+
diff --git a/src/makeBaseApp/top/configure/RELEASE b/src/makeBaseApp/top/configure/RELEASE
index ba28bcb26..dbd742b45 100644
--- a/src/makeBaseApp/top/configure/RELEASE
+++ b/src/makeBaseApp/top/configure/RELEASE
@@ -35,3 +35,9 @@ EPICS_BASE = _EPICS_BASE_
# Set RULES here if you want to use build rules from somewhere
# other than EPICS_BASE:
#RULES = $(MODULES)/build-rules
+
+# These allow developers to override the RELEASE variable settings
+# without having to modify the configure/RELEASE file itself.
+-include $(TOP)/../RELEASE.local
+-include $(TOP)/configure/RELEASE.local
+
From f1439f8b1c5ee21285415344fc1aac9562ca0dbd Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 15 Nov 2016 09:56:42 -0600
Subject: [PATCH 47/70] Fix epicsStdioTest for MS 2015 compiler
---
src/libCom/test/epicsStdioTest.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/libCom/test/epicsStdioTest.c b/src/libCom/test/epicsStdioTest.c
index 54fc3a48a..a2c57ecac 100644
--- a/src/libCom/test/epicsStdioTest.c
+++ b/src/libCom/test/epicsStdioTest.c
@@ -38,7 +38,14 @@ static void testEpicsSnprintf(void) {
const char *expected = exbuffer;
int size;
int rtn, rlen;
-
+
+#ifdef _WIN32
+#if (defined(_MSC_VER) && _MSC_VER < 1900) || \
+ (defined(_MINGW) && defined(_TWO_DIGIT_EXPONENT))
+ _set_output_format(_TWO_DIGIT_EXPONENT);
+#endif
+#endif
+
sprintf(exbuffer, format, ivalue, fvalue, svalue);
rlen = strlen(expected)+1;
@@ -122,11 +129,7 @@ void testStdoutRedir (const char *report)
MAIN(epicsStdioTest)
{
-#ifdef _WIN32
- testPlan(166);
-#else
testPlan(163);
-#endif
testEpicsSnprintf();
testStdoutRedir("report");
return testDone();
From 726d7c67159034f7e3b1a3dc6ca4a199bd0fdc00 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 15 Nov 2016 10:34:10 -0600
Subject: [PATCH 48/70] Fix chfPluginTest for MS 2015 compiler
---
src/ioc/db/test/chfPluginTest.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/ioc/db/test/chfPluginTest.c b/src/ioc/db/test/chfPluginTest.c
index 4b12644ea..becd876e8 100644
--- a/src/ioc/db/test/chfPluginTest.c
+++ b/src/ioc/db/test/chfPluginTest.c
@@ -541,8 +541,11 @@ MAIN(chfPluginTest)
dbChannel *pch;
db_field_log *pfl;
-#if defined(WIN32) && (!defined(_MINGW) || __MSVCRT_VERSION__ >= 0x0800)
+#ifdef _WIN32
+#if (defined(_MSC_VER) && _MSC_VER < 1900) || \
+ (defined(_MINGW) && defined(_TWO_DIGIT_EXPONENT))
_set_output_format(_TWO_DIGIT_EXPONENT);
+#endif
#endif
testPlan(1433);
From 2841af7069ee2f1b47116a987e8ecdc6a411476a Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Tue, 29 Nov 2016 14:48:57 +0100
Subject: [PATCH 49/70] rec: add promptgroups for OFFS and SHFT of fanout and
seq
---
src/std/rec/fanoutRecord.dbd | 6 ++++--
src/std/rec/seqRecord.dbd | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/std/rec/fanoutRecord.dbd b/src/std/rec/fanoutRecord.dbd
index 40968945c..251d63a11 100644
--- a/src/std/rec/fanoutRecord.dbd
+++ b/src/std/rec/fanoutRecord.dbd
@@ -36,12 +36,14 @@ recordtype(fanout) {
}
field(OFFS,DBF_SHORT) {
prompt("Offset for Specified")
- interest(1)
+ promptgroup("30 - Action")
+ interest(1)
initial("0")
}
field(SHFT,DBF_SHORT) {
prompt("Shift for Mask mode")
- interest(1)
+ promptgroup("30 - Action")
+ interest(1)
initial("-1")
}
field(LNK0,DBF_FWDLINK) {
diff --git a/src/std/rec/seqRecord.dbd b/src/std/rec/seqRecord.dbd
index c40d17c38..826f3ecf6 100644
--- a/src/std/rec/seqRecord.dbd
+++ b/src/std/rec/seqRecord.dbd
@@ -36,11 +36,13 @@ recordtype(seq) {
}
field(OFFS,DBF_SHORT) {
prompt("Offset for Specified")
+ promptgroup("30 - Action")
interest(1)
initial("0")
}
field(SHFT,DBF_SHORT) {
prompt("Shift for Mask mode")
+ promptgroup("30 - Action")
interest(1)
initial("-1")
}
From 0f7f4710c6a6c9e8fe94c2527d050928405aa296 Mon Sep 17 00:00:00 2001
From: Wang Xiaoqiang
Date: Wed, 30 Nov 2016 11:58:24 -0600
Subject: [PATCH 50/70] PCAS dynamic array support for GDD container types
---
src/cas/generic/casStrmClient.cc | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc
index 6cfab04dd..e23a2b8df 100644
--- a/src/cas/generic/casStrmClient.cc
+++ b/src/cas/generic/casStrmClient.cc
@@ -856,8 +856,20 @@ caStatus casStrmClient::monitorResponse (
casChannelI & chan, const caHdrLargeArray & msg,
const gdd & desc, const caStatus completionStatus )
{
+ aitUint32 elementCount = 0;
+ if (desc.isContainer()) {
+ aitUint32 index;
+ int gdds = gddApplicationTypeTable::app_table.mapAppToIndex
+ ( desc.applicationType(), gddAppType_value, index );
+ if ( gdds ) {
+ return S_cas_badType;
+ }
+ elementCount = desc.getDD(index)->getDataSizeElements();
+ } else {
+ elementCount = desc.getDataSizeElements();
+ }
ca_uint32_t count = (msg.m_count == 0) ?
- (ca_uint32_t)desc.getDataSizeElements() :
+ (ca_uint32_t)elementCount :
msg.m_count;
void * pPayload = 0;
From 666721c7ada87b5dca878f76b0429e7b1e4c7ee7 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 6 Dec 2016 12:16:35 -0600
Subject: [PATCH 51/70] Document caput scalar arg's, update usage docs
---
src/ca/CAref.html | 113 +++++++++++++++++++++++++++-----------------
src/catools/caput.c | 8 ++--
2 files changed, 75 insertions(+), 46 deletions(-)
diff --git a/src/ca/CAref.html b/src/ca/CAref.html
index 91bc6bed2..0b9af7b30 100644
--- a/src/ca/CAref.html
+++ b/src/ca/CAref.html
@@ -1146,16 +1146,10 @@ the output.
Wide mode "name timestamp value stat sevr" (read PVs as
DBR_TIME_xxx) |
-
- | -n |
- Print DBF_ENUM values as number (default are enum strings) |
-
| -d <type> |
- Request specific dbr type; use string (DBR_ prefix may be omitted)
-
- or number of one of the following types:
-
+ | Request specific dbr type; use string (DBR_ prefix may be omitted)
+ or number of one of the following types:
@@ -1272,6 +1266,14 @@ the output.
|
+
+ |
+ Enum format: |
+
+
+ | -n |
+ Print DBF_ENUM value as number (default is enum string) |
+
|
Arrays: |
@@ -1303,15 +1305,15 @@ the output.
| -e <nr> |
- Use %e format, with <nr> digits after the decimal point |
+ Use %e format, with a precision of <nr> digits |
| -f <nr> |
- Use %f format, with <nr> digits after the decimal point |
+ Use %f format, with a precision of <nr> digits |
| -g <nr> |
- Use %g format, with <nr> digits after the decimal point |
+ Use %g format, with a precision of <nr> digits |
| -s |
@@ -1349,6 +1351,14 @@ the output.
-0b |
Print as binary number |
+
+ |
+ Alternate output field separator: |
+
+
+ | -F <ofs> |
+ Use <ofs> as an alternate output field separator |
+
@@ -1381,9 +1391,10 @@ the output.
Wait time, specifies longer CA timeout, default is 1.0 second |
- | -m <mask> |
- Specify CA event mask to use, with <mask> being any combination
- of 'v' (value), 'a' (alarm), 'l' (log), 'p' (property). Default: va |
+ -m <msk> |
+ Specify CA event mask to use. <msk> is any combination of
+ 'v' (value), 'a' (alarm), 'l' (log/archive), 'p' (property).
+ Default event mask is 'va' |
| -p <prio> |
@@ -1405,8 +1416,8 @@ the output.
'n' = no timestamps
'r' = relative timestamps (time elapsed since start of program)
'i' = incremental timestamps (time elapsed since last update)
- 'I' = incremental timestamps (time elapsed since last update, by
- channel)
+ 'I' = incremental timestamps (time since last update, by channel)
+ 'r', 'i' or 'I' require 's' or 'c' to select the time source
|
@@ -1414,7 +1425,7 @@ the output.
| -n |
- Print DBF_ENUM values as number (default are enum strings) |
+ Print DBF_ENUM values as number (default is enum string) |
|
@@ -1422,16 +1433,15 @@ the output.
|
- Value format: Print number of requested values, then list of
- values |
+ Array values: Print number of elements, then list of values |
| Default: |
- Print all values |
+ Default: Request and print all elements (dynamic arrays supported) |
- | -# <count> |
- Print first <count> elements of an array |
+ -# <num> |
+ Request and print up to <num> elements |
| -S |
@@ -1439,23 +1449,23 @@ the output.
|
- Floating point type format: |
+ Floating point format: |
| Default: |
Use %g format |
- | -e <nr> |
- Use %e format, with <nr> digits after the decimal point |
+ -e <num> |
+ Use %e format, with a precision of <num> digits |
- | -f <nr> |
- Use %f format, with <nr> digits after the decimal point |
+ -f <num> |
+ Use %f format, with a precision of <num> digits |
- | -g <nr> |
- Use %g format, with <nr> digits after the decimal point |
+ -g <num> |
+ Use %g format, with a precision of <num> digits |
| -s |
@@ -1497,21 +1507,27 @@ the output.
-caput [options] <PV name> <value>
+caput [options] <PV name> <value> ...
caput -a [options] <PV name> <no of elements> <value> ...
Description
Put value to a PV.
-The specified value is written to the PV (as a string). The PV value is read
-before and after the write operation and printed as "Old" and "new" values on
-stdout.
+The specified value is written to the PV (as a string). The PV's value is
+read before and after the write operation and printed as "Old" and "New" values
+on stdout.
-The array variant writes an array to the specified PV. The first numeric
-argument specifying the number of array elements is kept for compatibility with
-the array data format of caget - the actual number of values specified on the
-command line is used.
+There are two variants to the arguments for this command. For the scalar
+variant without the -a flag, all the value arguments provided after
+the PV name are concatenated with a single space character between them, and the
+resulting string (up to 40 characters long unless the -S flag is
+given) is written to the specified PV.
+
+The array variant with the -a flag writes an array of string
+values to the specified PV. The numeric argument giving the number of array
+elements is actually ignored, the array length to be written is actually
+controlled by the number of values provided on the command line.
@@ -1550,12 +1566,16 @@ command line is used.
| -t |
Terse mode - print only successfully written value, without name |
+
+ | -l |
+ Long mode "name timestamp value stat sevr" (read PVs as DBR_TIME_xxx) |
+
|
Enum Format: |
- |
+ Default: |
Auto - try value as ENUM string, then as index number |
@@ -1571,17 +1591,24 @@ command line is used.
| Arrays: |
- | -a |
- Put array data |
+ Default: |
+ Put scalar |
|
- Value format: Print number of requested values, then list of
- values |
+ Value format: all value arguments concatenated with spaces |
| -S |
- Put string as an array of char (long string) |
+ Put string as an array of chars (long string) |
+
+
+ | -a |
+ Put array |
+
+
+ |
+ Value format: number of values, then list of values |
diff --git a/src/catools/caput.c b/src/catools/caput.c
index 02182932d..715672958 100644
--- a/src/catools/caput.c
+++ b/src/catools/caput.c
@@ -56,7 +56,7 @@ static epicsEventId epId;
void usage (void)
{
- fprintf (stderr, "\nUsage: caput [options] \n"
+ fprintf (stderr, "\nUsage: caput [options] ...\n"
" caput -a [options] ...\n\n"
" -h: Help: Print this message\n"
"Channel Access options:\n"
@@ -71,9 +71,11 @@ void usage (void)
" -n: Force interpretation of values as numbers\n"
" -s: Force interpretation of values as strings\n"
"Arrays:\n"
+ " Default: Put scalar\n"
+ " Value format: all value arguments concatenated with spaces\n"
+ " -S: Put string as an array of chars (long string)\n"
" -a: Put array\n"
- " Value format: number of requested values, then list of values\n"
- " -S: Put string as an array of char (long string)\n"
+ " Value format: number of values, then list of values\n"
"\nExample: caput my_channel 1.2\n"
" (puts 1.2 to my_channel)\n\n"
, DEFAULT_TIMEOUT, CA_PRIORITY_MAX);
From d3568605ce7bbd5d063a77f2f2a29f83a23cee3c Mon Sep 17 00:00:00 2001
From: Bruce Hill
Date: Tue, 6 Dec 2016 13:43:59 -0800
Subject: [PATCH 52/70] Fetch nativeCount() in casChannelI constructor to avoid
deadlock if we fetch it from eventSysProcess()
---
src/cas/generic/casChannelI.cc | 1 +
src/cas/generic/casChannelI.h | 7 +++++++
src/cas/generic/casStrmClient.cc | 8 ++++----
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/cas/generic/casChannelI.cc b/src/cas/generic/casChannelI.cc
index 588f67d78..c575ea483 100644
--- a/src/cas/generic/casChannelI.cc
+++ b/src/cas/generic/casChannelI.cc
@@ -21,6 +21,7 @@ casChannelI::casChannelI ( casCoreClient & clientIn,
casChannel & chanIn, casPVI & pvIn, ca_uint32_t cidIn ) :
privateForPV ( clientIn, *this ),
pv ( pvIn ),
+ maxElem( pvIn.nativeCount() ),
chan ( chanIn ),
cid ( cidIn ),
serverDeletePending ( false ),
diff --git a/src/cas/generic/casChannelI.h b/src/cas/generic/casChannelI.h
index 2c72e88e4..228fe6ab3 100644
--- a/src/cas/generic/casChannelI.h
+++ b/src/cas/generic/casChannelI.h
@@ -45,6 +45,7 @@ public:
void clearOutstandingReads ();
void postAccessRightsEvent ();
const gddEnumStringTable & enumStringTable () const;
+ ca_uint32_t getMaxElem () const;
void setOwner ( const char * const pUserName,
const char * const pHostName );
bool readAccess () const;
@@ -58,6 +59,7 @@ private:
chanIntfForPV privateForPV;
tsDLList < casAsyncIOI > ioList;
casPVI & pv;
+ ca_uint32_t maxElem;
casChannel & chan;
caResId cid; // client id
bool serverDeletePending;
@@ -77,6 +79,11 @@ inline casPVI & casChannelI::getPVI () const
return this->pv;
}
+inline ca_uint32_t casChannelI::getMaxElem () const
+{
+ return this->maxElem;
+}
+
inline const caResId casChannelI::getCID ()
{
return this->cid;
diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc
index e23a2b8df..60903787c 100644
--- a/src/cas/generic/casStrmClient.cc
+++ b/src/cas/generic/casStrmClient.cc
@@ -409,7 +409,7 @@ caStatus casStrmClient::verifyRequest (casChannelI * & pChan , bool allowdyn)
//
// element count out of range ?
//
- if ( ctx.msg.m_count > pChan->getPVI().nativeCount() ||
+ if ( ctx.msg.m_count > pChan->getMaxElem() ||
( !allowdyn && ctx.msg.m_count == 0u ) ) {
return ECA_BADCOUNT;
}
@@ -895,7 +895,7 @@ caStatus casStrmClient::monitorResponse (
gdd * pDBRDD = 0;
if ( completionStatus == S_cas_success ) {
caStatus status = createDBRDD ( msg.m_dataType, count,
- chan.getPVI().nativeCount(), pDBRDD );
+ chan.getMaxElem(), pDBRDD );
if ( status != S_cas_success ) {
caStatus ecaStatus;
if ( status == S_cas_badType ) {
@@ -1866,7 +1866,7 @@ caStatus casStrmClient::privateCreateChanResponse (
// the protocol buffer.
//
assert ( nativeTypeDBR <= 0xffff );
- aitIndex nativeCount = chan.getPVI().nativeCount();
+ aitIndex nativeCount = chan.getMaxElem();
assert ( nativeCount <= 0xffffffff );
assert ( hdr.m_cid == chan.getCID() );
status = this->out.copyInHeader ( CA_PROTO_CREATE_CHAN, 0,
@@ -2626,7 +2626,7 @@ caStatus casStrmClient::read ()
{
gdd * pDD = 0;
caStatus status = createDBRDD ( pHdr->m_dataType, pHdr->m_count,
- this->ctx.getChannel()->getPVI().nativeCount(), pDD );
+ this->ctx.getChannel()->getMaxElem(), pDD );
if ( status != S_cas_success ) {
return status;
}
From 94397b52fca8967b46387c74f93db6b5866aa686 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 7 Dec 2016 13:53:26 -0600
Subject: [PATCH 53/70] Resolve some cppcheck errors & warnings
---
src/RTEMS/base/rtems_init.c | 6 +-
src/ca/repeater.cpp | 1 +
src/ca/udpiiu.cpp | 10 +-
src/cas/example/directoryService/main.cc | 2 +-
src/cas/generic/casDGClient.cc | 337 ++++++++++----------
src/cas/generic/casStrmClient.cc | 1 +
src/db/dbCaTest.c | 4 +-
src/db/dbConvert.c | 6 +-
src/db/db_test.c | 6 +-
src/gdd/gddTest.cc | 4 +-
src/libCom/osi/epicsGeneralTime.c | 2 +-
src/libCom/osi/os/RTEMS/osdMessageQueue.c | 2 +-
src/libCom/osi/os/RTEMS/osdThread.c | 2 -
src/libCom/osi/os/WIN32/osdThread.c | 9 +-
src/makeBaseApp/top/caClientApp/caMonitor.c | 1 +
src/rec/histogramRecord.c | 2 +-
src/rsrv/camessage.c | 3 +-
src/util/iocLogServer.c | 198 ++++++------
18 files changed, 299 insertions(+), 297 deletions(-)
diff --git a/src/RTEMS/base/rtems_init.c b/src/RTEMS/base/rtems_init.c
index dd136b755..2b909ab3b 100644
--- a/src/RTEMS/base/rtems_init.c
+++ b/src/RTEMS/base/rtems_init.c
@@ -489,7 +489,7 @@ exitHandler(void)
rtems_task
Init (rtems_task_argument ignored)
{
- int i;
+ int result;
char *argv[3] = { NULL, NULL, NULL };
char *cp;
rtems_task_priority newpri;
@@ -612,8 +612,8 @@ Init (rtems_task_argument ignored)
set_directory (argv[1]);
epicsEnvSet ("IOC_STARTUP_SCRIPT", argv[1]);
atexit(exitHandler);
- i = main ((sizeof argv / sizeof argv[0]) - 1, argv);
+ result = main ((sizeof argv / sizeof argv[0]) - 1, argv);
printf ("***** IOC application terminating *****\n");
epicsThreadSleep(1.0);
- epicsExit(0);
+ epicsExit(result);
}
diff --git a/src/ca/repeater.cpp b/src/ca/repeater.cpp
index 5e123ee2d..61ba33fc5 100644
--- a/src/ca/repeater.cpp
+++ b/src/ca/repeater.cpp
@@ -504,6 +504,7 @@ void ca_repeater ()
if ( sockerrno == SOCK_EADDRINUSE ) {
osiSockRelease ();
debugPrintf ( ( "CA Repeater: exiting because a repeater is already running\n" ) );
+ delete [] pBuf;
return;
}
char sockErrBuf[64];
diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp
index e4e8bd31f..c7a6f832f 100644
--- a/src/ca/udpiiu.cpp
+++ b/src/ca/udpiiu.cpp
@@ -902,10 +902,12 @@ bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
caHdr * pbufmsg = ( caHdr * ) &this->xmitBuf[this->nBytesInXmitBuf];
*pbufmsg = msg;
- memcpy ( pbufmsg + 1, pExt, extsize );
- if ( extsize != alignedExtSize ) {
- char *pDest = (char *) ( pbufmsg + 1 );
- memset ( pDest + extsize, '\0', alignedExtSize - extsize );
+ if ( extsize ) {
+ memcpy ( pbufmsg + 1, pExt, extsize );
+ if ( extsize != alignedExtSize ) {
+ char *pDest = (char *) ( pbufmsg + 1 );
+ memset ( pDest + extsize, '\0', alignedExtSize - extsize );
+ }
}
AlignedWireRef < epicsUInt16 > ( pbufmsg->m_postsize ) = alignedExtSize;
this->nBytesInXmitBuf += msgsize;
diff --git a/src/cas/example/directoryService/main.cc b/src/cas/example/directoryService/main.cc
index afd4f813c..392f07c5b 100644
--- a/src/cas/example/directoryService/main.cc
+++ b/src/cas/example/directoryService/main.cc
@@ -170,7 +170,7 @@ static int parseDirectoryFP (FILE *pf, const char *pFileName)
status = aToIPAddr (hostNameStr, 0u, &ipa);
if (status) {
- fprintf (pf, "Unknown host name=\"%s\" (or bad dotted ip addr) in \"%s\" with PV=\"%s\"?\n",
+ fprintf (stderr, "Unknown host name=\"%s\" (or bad dotted ip addr) in \"%s\" with PV=\"%s\"?\n",
hostNameStr, pFileName, pvNameStr);
return -1;
}
diff --git a/src/cas/generic/casDGClient.cc b/src/cas/generic/casDGClient.cc
index bf9037288..3bb32c3e2 100644
--- a/src/cas/generic/casDGClient.cc
+++ b/src/cas/generic/casDGClient.cc
@@ -24,39 +24,39 @@
casDGClient::pCASMsgHandler const casDGClient::msgHandlers[] =
{
- & casDGClient::versionAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
+ & casDGClient::versionAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
& casDGClient::uknownMessageAction,
& casDGClient::searchAction,
& casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::echoAction,
- & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::echoAction,
+ & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction,
- & casDGClient::uknownMessageAction
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction,
+ & casDGClient::uknownMessageAction
};
//
@@ -84,7 +84,7 @@ casDGClient::~casDGClient()
//
void casDGClient::destroy()
{
- printf("Attempt to destroy the DG client was ignored\n");
+ printf("Attempt to destroy the DG client was ignored\n");
}
//
@@ -92,16 +92,16 @@ void casDGClient::destroy()
//
void casDGClient::show (unsigned level) const
{
- printf ( "casDGClient at %p\n",
+ printf ( "casDGClient at %p\n",
static_cast ( this ) );
- if (level>=1u) {
- char buf[64];
- this->hostName (buf, sizeof(buf));
- printf ("Client Host=%s\n", buf);
+ if (level>=1u) {
+ char buf[64];
+ this->hostName (buf, sizeof(buf));
+ printf ("Client Host=%s\n", buf);
this->casCoreClient::show ( level - 1u );
this->in.show ( level - 1u );
this->out.show ( level - 1u );
- }
+ }
}
//
@@ -109,7 +109,7 @@ void casDGClient::show (unsigned level) const
//
caStatus casDGClient::uknownMessageAction ()
{
- const caHdrLargeArray * mp = this->ctx.getMsg();
+ const caHdrLargeArray * mp = this->ctx.getMsg();
char pHostName[64u];
this->lastRecvAddr.stringConvert ( pHostName, sizeof ( pHostName ) );
@@ -117,7 +117,7 @@ caStatus casDGClient::uknownMessageAction ()
caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
"bad request code=%u in DG\n", mp->m_cmmd );
- return S_cas_badProtocol;
+ return S_cas_badProtocol;
}
//
@@ -125,9 +125,9 @@ caStatus casDGClient::uknownMessageAction ()
//
caStatus casDGClient::searchAction()
{
- const caHdrLargeArray *mp = this->ctx.getMsg();
+ const caHdrLargeArray *mp = this->ctx.getMsg();
const char *pChanName = static_cast ( this->ctx.getData() );
- caStatus status;
+ caStatus status;
//
// check the sanity of the message
@@ -135,7 +135,7 @@ caStatus casDGClient::searchAction()
if ( mp->m_postsize <= 1 ) {
char pHostName[64u];
this->lastRecvAddr.stringConvert ( pHostName, sizeof ( pHostName ) );
- caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
+ caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
"empty PV name extension in UDP search request?\n" );
return S_cas_success;
}
@@ -143,7 +143,7 @@ caStatus casDGClient::searchAction()
if ( pChanName[0] == '\0' ) {
char pHostName[64u];
this->lastRecvAddr.stringConvert ( pHostName, sizeof ( pHostName ) );
- caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
+ caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
"zero length PV name in UDP search request?\n" );
return S_cas_success;
}
@@ -155,56 +155,56 @@ caStatus casDGClient::searchAction()
if ( i <= 1 ) {
char pHostName[64u];
this->lastRecvAddr.stringConvert ( pHostName, sizeof ( pHostName ) );
- caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
+ caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
"unterminated PV name in UDP search request?\n" );
return S_cas_success;
}
}
- if ( this->getCAS().getDebugLevel() > 6u ) {
- char pHostName[64u];
- this->hostName ( pHostName, sizeof ( pHostName ) );
- printf ( "\"%s\" is searching for \"%s\"\n",
+ if ( this->getCAS().getDebugLevel() > 6u ) {
+ char pHostName[64u];
+ this->hostName ( pHostName, sizeof ( pHostName ) );
+ printf ( "\"%s\" is searching for \"%s\"\n",
pHostName, pChanName );
- }
+ }
- //
- // verify that we have sufficent memory for a PV and a
- // monitor prior to calling PV exist test so that when
- // the server runs out of memory we dont reply to
- // search requests, and therefore dont thrash through
- // caServer::pvExistTest() and casCreatePV::pvAttach()
- //
+ //
+ // verify that we have sufficent memory for a PV and a
+ // monitor prior to calling PV exist test so that when
+ // the server runs out of memory we dont reply to
+ // search requests, and therefore dont thrash through
+ // caServer::pvExistTest() and casCreatePV::pvAttach()
+ //
if ( ! osiSufficentSpaceInPool ( 0 ) ) {
return S_cas_success;
}
- //
- // ask the server tool if this PV exists
- //
- this->userStartedAsyncIO = false;
- pvExistReturn pver =
- this->getCAS()->pvExistTest ( this->ctx, this->lastRecvAddr, pChanName );
+ //
+ // ask the server tool if this PV exists
+ //
+ this->userStartedAsyncIO = false;
+ pvExistReturn pver =
+ this->getCAS()->pvExistTest ( this->ctx, this->lastRecvAddr, pChanName );
- //
- // prevent problems when they initiate
- // async IO but dont return status
- // indicating so (and vise versa)
- //
- if ( this->userStartedAsyncIO ) {
+ //
+ // prevent problems when they initiate
+ // async IO but dont return status
+ // indicating so (and vise versa)
+ //
+ if ( this->userStartedAsyncIO ) {
if ( pver.getStatus() != pverAsyncCompletion ) {
- errMessage (S_cas_badParameter,
- "- assuming asynch IO status from caServer::pvExistTest()");
+ errMessage (S_cas_badParameter,
+ "- assuming asynch IO status from caServer::pvExistTest()");
}
status = S_cas_success;
- }
- else {
- //
- // otherwise we assume sync IO operation was initiated
- //
+ }
+ else {
+ //
+ // otherwise we assume sync IO operation was initiated
+ //
switch ( pver.getStatus() ) {
case pverExistsHere:
- status = this->searchResponse (*mp, pver);
+ status = this->searchResponse (*mp, pver);
break;
case pverDoesNotExistHere:
@@ -212,18 +212,18 @@ caStatus casDGClient::searchAction()
break;
case pverAsyncCompletion:
- errMessage (S_cas_badParameter,
- "- unexpected asynch IO status from caServer::pvExistTest() ignored");
+ errMessage (S_cas_badParameter,
+ "- unexpected asynch IO status from caServer::pvExistTest() ignored");
status = S_cas_success;
break;
default:
- errMessage (S_cas_badParameter,
- "- invalid return from caServer::pvExistTest() ignored");
+ errMessage (S_cas_badParameter,
+ "- invalid return from caServer::pvExistTest() ignored");
status = S_cas_success;
break;
- }
- }
+ }
+ }
return status;
}
@@ -340,21 +340,21 @@ caStatus casDGClient::searchResponse ( const caHdrLargeArray & msg,
}
//
-// casDGClient::searchFailResponse()
-// (only when requested by the client
-// - when it isnt a reply to a broadcast)
+// casDGClient::searchFailResponse()
+// (only when requested by the client
+// - when it isnt a reply to a broadcast)
//
caStatus casDGClient::searchFailResponse ( const caHdrLargeArray * mp )
{
- int status;
+ int status;
epicsGuard < epicsMutex > guard ( this->mutex );
status = this->out.copyInHeader ( CA_PROTO_NOT_FOUND, 0,
mp->m_dataType, mp->m_count, mp->m_cid, mp->m_available, 0 );
- this->out.commitMsg ();
+ this->out.commitMsg ();
- return S_cas_success;
+ return S_cas_success;
}
/*
@@ -362,7 +362,7 @@ caStatus casDGClient::searchFailResponse ( const caHdrLargeArray * mp )
*/
caStatus casDGClient::versionAction ()
{
- const caHdrLargeArray * mp = this->ctx.getMsg();
+ const caHdrLargeArray * mp = this->ctx.getMsg();
if ( mp->m_count != 0 ) {
this->minor_version_number = static_cast ( mp->m_count );
@@ -373,7 +373,7 @@ caStatus casDGClient::versionAction ()
this->seqNoOfReq = 0;
}
}
- return S_cas_success;
+ return S_cas_success;
}
//
@@ -382,25 +382,25 @@ caStatus casDGClient::versionAction ()
//
void casDGClient::sendBeacon ( ca_uint32_t beaconNumber )
{
- union {
- caHdr msg;
- char buf;
- };
+ union {
+ caHdr msg;
+ char buf;
+ };
- //
- // create the message
- //
- memset ( & buf, 0, sizeof ( msg ) );
+ //
+ // create the message
+ //
+ memset ( & buf, 0, sizeof ( msg ) );
AlignedWireRef < epicsUInt16 > ( msg.m_cmmd ) = CA_PROTO_RSRV_IS_UP;
AlignedWireRef < epicsUInt16 > ( msg.m_dataType ) = CA_MINOR_PROTOCOL_REVISION;
AlignedWireRef < epicsUInt32 > ( msg.m_cid ) = beaconNumber;
- //
- // send it to all addresses on the beacon list,
+ //
+ // send it to all addresses on the beacon list,
// but let the IO specific code set the address
// field and the port field
- //
- this->sendBeaconIO ( buf, sizeof (msg), msg.m_count, msg.m_available );
+ //
+ this->sendBeaconIO ( buf, sizeof (msg), msg.m_count, msg.m_available );
}
//
@@ -421,8 +421,8 @@ outBufClient::flushCondition casDGClient::xSend ( char *pBufIn,
if ( pHdr->cadg_addr.isValid() ) {
outBufClient::flushCondition stat =
- this->osdSend ( pDG, sizeDG, pHdr->cadg_addr );
- if ( stat != outBufClient::flushProgress ) {
+ this->osdSend ( pDG, sizeDG, pHdr->cadg_addr );
+ if ( stat != outBufClient::flushProgress ) {
break;
}
}
@@ -431,10 +431,10 @@ outBufClient::flushCondition casDGClient::xSend ( char *pBufIn,
}
if ( totalBytes ) {
- //
- // !! this time fetch may be slowing things down !!
- //
- //this->lastSendTS = epicsTime::getCurrent();
+ //
+ // !! this time fetch may be slowing things down !!
+ //
+ //this->lastSendTS = epicsTime::getCurrent();
nBytesSent = totalBytes;
return outBufClient::flushProgress;
}
@@ -457,16 +457,16 @@ inBufClient::fillCondition casDGClient::xRecv (char *pBufIn, bufSizeT nBytesToRe
while (pAfter-pCurBuf >= static_cast(MAX_UDP_RECV+sizeof(cadg))) {
pHdr = reinterpret_cast < cadg * > ( pCurBuf );
- stat = this->osdRecv ( reinterpret_cast < char * > ( pHdr + 1 ),
+ stat = this->osdRecv ( reinterpret_cast < char * > ( pHdr + 1 ),
MAX_UDP_RECV, parm, nDGBytesRecv, pHdr->cadg_addr);
- if (stat==casFillProgress) {
+ if (stat==casFillProgress) {
pHdr->cadg_nBytes = nDGBytesRecv + sizeof(*pHdr);
pCurBuf += pHdr->cadg_nBytes;
- //
- // !! this time fetch may be slowing things down !!
- //
- //this->lastRecvTS = epicsTime::getCurrent();
- }
+ //
+ // !! this time fetch may be slowing things down !!
+ //
+ //this->lastRecvTS = epicsTime::getCurrent();
+ }
else {
break;
}
@@ -517,7 +517,7 @@ caStatus casDGClient::asyncSearchResponse (
pMsg->m_dataType = htons ( sequenceNoIsValid );
}
- caStatus stat = this->searchResponse ( msg, retVal );
+ caStatus stat = this->searchResponse ( msg, retVal );
pRespHdr->cadg_nBytes = this->out.popCtx (outctx) + sizeof ( *pRespHdr );
if ( pRespHdr->cadg_nBytes > sizeof ( *pRespHdr ) + sizeof (caHdr) ) {
@@ -525,7 +525,7 @@ caStatus casDGClient::asyncSearchResponse (
this->out.commitRawMsg ( pRespHdr->cadg_nBytes );
}
- return stat;
+ return stat;
}
//
@@ -655,7 +655,7 @@ caStatus casDGClient::processDG ()
//
unsigned casDGClient::getDebugLevel() const
{
- return this->getCAS().getDebugLevel();
+ return this->getCAS().getDebugLevel();
}
//
@@ -663,7 +663,7 @@ unsigned casDGClient::getDebugLevel() const
//
caNetAddr casDGClient::fetchLastRecvAddr () const
{
- return this->lastRecvAddr;
+ return this->lastRecvAddr;
}
//
@@ -671,7 +671,7 @@ caNetAddr casDGClient::fetchLastRecvAddr () const
//
ca_uint32_t casDGClient::datagramSequenceNumber () const
{
- return this->seqNoOfReq;
+ return this->seqNoOfReq;
}
//
@@ -731,27 +731,27 @@ outBufClient::flushCondition casDGClient::flush ()
//
caStatus casDGClient::processMsg ()
{
- int status = S_cas_success;
+ int status = S_cas_success;
try {
- unsigned bytesLeft;
- while ( ( bytesLeft = this->in.bytesPresent() ) ) {
+ unsigned bytesLeft;
+ while ( ( bytesLeft = this->in.bytesPresent() ) ) {
caHdrLargeArray msgTmp;
unsigned msgSize;
ca_uint32_t hdrSize;
char * rawMP;
{
- //
- // copy as raw bytes in order to avoid
- // alignment problems
- //
+ //
+ // copy as raw bytes in order to avoid
+ // alignment problems
+ //
caHdr smallHdr;
if ( bytesLeft < sizeof ( smallHdr ) ) {
break;
}
rawMP = this->in.msgPtr ();
- memcpy ( & smallHdr, rawMP, sizeof ( smallHdr ) );
+ memcpy ( & smallHdr, rawMP, sizeof ( smallHdr ) );
ca_uint32_t payloadSize = AlignedWireRef < epicsUInt16 > ( smallHdr.m_postsize );
ca_uint32_t nElem = AlignedWireRef < epicsUInt16 > ( smallHdr.m_count );
@@ -800,45 +800,45 @@ caStatus casDGClient::processMsg ()
this->ctx.setMsg ( msgTmp, rawMP + hdrSize );
- if ( this->getCAS().getDebugLevel() > 5u ) {
+ if ( this->getCAS().getDebugLevel() > 5u ) {
char pHostName[64u];
this->lastRecvAddr.stringConvert ( pHostName, sizeof ( pHostName ) );
- caServerI::dumpMsg ( pHostName, "?",
+ caServerI::dumpMsg ( pHostName, "?",
& msgTmp, rawMP + hdrSize, 0 );
- }
+ }
}
- //
- // Reset the context to the default
- // (guarantees that previous message does not get mixed
- // up with the current message)
- //
- this->ctx.setChannel ( NULL );
- this->ctx.setPV ( NULL );
+ //
+ // Reset the context to the default
+ // (guarantees that previous message does not get mixed
+ // up with the current message)
+ //
+ this->ctx.setChannel ( NULL );
+ this->ctx.setPV ( NULL );
- //
- // Call protocol stub
- //
+ //
+ // Call protocol stub
+ //
casDGClient::pCASMsgHandler pHandler;
- if ( msgTmp.m_cmmd < NELEMENTS ( casDGClient::msgHandlers ) ) {
+ if ( msgTmp.m_cmmd < NELEMENTS ( casDGClient::msgHandlers ) ) {
pHandler = this->casDGClient::msgHandlers[msgTmp.m_cmmd];
- }
+ }
else {
pHandler = & casDGClient::uknownMessageAction;
}
- status = ( this->*pHandler ) ();
- if ( status ) {
+ status = ( this->*pHandler ) ();
+ if ( status ) {
this->in.removeMsg ( this->in.bytesPresent() );
- break;
- }
+ break;
+ }
this->in.removeMsg ( msgSize );
- }
+ }
}
catch ( std::exception & except ) {
this->in.removeMsg ( this->in.bytesPresent() );
- status = this->sendErr (
+ this->sendErr (
this->ctx.getMsg(), invalidResID, ECA_INTERNAL,
"C++ exception \"%s\" in CA circuit server",
except.what () );
@@ -846,13 +846,13 @@ caStatus casDGClient::processMsg ()
}
catch (...) {
this->in.removeMsg ( this->in.bytesPresent() );
- status = this->sendErr (
+ this->sendErr (
this->ctx.getMsg(), invalidResID, ECA_INTERNAL,
"unexpected C++ exception in CA datagram server" );
status = S_cas_internal;
}
- return status;
+ return status;
}
//
@@ -861,24 +861,25 @@ caStatus casDGClient::processMsg ()
caStatus casDGClient::sendErr ( const caHdrLargeArray *curp,
ca_uint32_t cid, const int reportedStatus, const char *pformat, ... )
{
- unsigned stringSize;
- char msgBuf[1024]; /* allocate plenty of space for the message string */
- if ( pformat ) {
- va_list args;
- va_start ( args, pformat );
- int status = vsprintf ( msgBuf, pformat, args );
- if ( status < 0 ) {
- errPrintf (S_cas_internal, __FILE__, __LINE__,
- "bad sendErr(%s)", pformat);
- stringSize = 0u;
- }
- else {
- stringSize = 1u + (unsigned) status;
- }
- }
- else {
- stringSize = 0u;
- }
+ unsigned stringSize;
+ char msgBuf[1024]; /* allocate plenty of space for the message string */
+ if ( pformat ) {
+ va_list args;
+ va_start ( args, pformat );
+ int status = vsprintf ( msgBuf, pformat, args );
+ if ( status < 0 ) {
+ errPrintf (S_cas_internal, __FILE__, __LINE__,
+ "bad sendErr(%s)", pformat);
+ stringSize = 0u;
+ }
+ else {
+ stringSize = 1u + (unsigned) status;
+ }
+ va_end ( args );
+ }
+ else {
+ stringSize = 0u;
+ }
unsigned hdrSize = sizeof ( caHdr );
if ( ( curp->m_postsize >= 0xffff || curp->m_count >= 0xffff ) &&
@@ -929,7 +930,7 @@ caStatus casDGClient::sendErr ( const caHdrLargeArray *curp,
this->out.commitMsg ();
}
- return S_cas_success;
+ return S_cas_success;
}
@@ -938,8 +939,8 @@ caStatus casDGClient::sendErr ( const caHdrLargeArray *curp,
//
caStatus casDGClient::echoAction ()
{
- const caHdrLargeArray * mp = this->ctx.getMsg();
- const void * dp = this->ctx.getData();
+ const caHdrLargeArray * mp = this->ctx.getMsg();
+ const void * dp = this->ctx.getData();
void * pPayloadOut;
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -950,5 +951,5 @@ caStatus casDGClient::echoAction ()
memcpy ( pPayloadOut, dp, mp->m_postsize );
this->out.commitMsg ();
}
- return S_cas_success;
+ return S_cas_success;
}
diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc
index 60903787c..c18e5bfa4 100644
--- a/src/cas/generic/casStrmClient.cc
+++ b/src/cas/generic/casStrmClient.cc
@@ -2773,6 +2773,7 @@ caStatus casStrmClient::sendErr ( epicsGuard &,
else {
stringSize = 1u + (unsigned) status;
}
+ va_end ( args );
}
else {
stringSize = 0u;
diff --git a/src/db/dbCaTest.c b/src/db/dbCaTest.c
index e4103068a..4eb407129 100644
--- a/src/db/dbCaTest.c
+++ b/src/db/dbCaTest.c
@@ -126,8 +126,8 @@ long dbcar(char *precordname, int level)
precord->name,
pdbFldDes->name,
plink->value.pv_link.pvname,
- pca->nDisconnect,
- pca->nNoWrite);
+ pca ? pca->nDisconnect : 0,
+ pca ? pca->nNoWrite : 0);
}
}
}
diff --git a/src/db/dbConvert.c b/src/db/dbConvert.c
index 303c1e1a8..deb1b1319 100644
--- a/src/db/dbConvert.c
+++ b/src/db/dbConvert.c
@@ -3941,10 +3941,9 @@ static long putFloatString(
char *pdest=(char *)(paddr->pfield);
long status = 0;
int precision = 6;
- struct rset *prset = 0;
+ struct rset *prset = dbGetRset(paddr);
short size=paddr->field_size;
- if(paddr) prset = dbGetRset(paddr);
if(prset && (prset->get_precision))
status = (*prset->get_precision)(paddr,&precision);
if(nRequest==1 && offset==0) {
@@ -4152,10 +4151,9 @@ static long putDoubleString(
char *pdest=(char *)(paddr->pfield);
long status = 0;
int precision = 6;
- struct rset *prset = 0;
+ struct rset *prset = dbGetRset(paddr);
short size=paddr->field_size;
- if(paddr) prset = dbGetRset(paddr);
if(prset && (prset->get_precision))
status = (*prset->get_precision)(paddr,&precision);
if(nRequest==1 && offset==0) {
diff --git a/src/db/db_test.c b/src/db/db_test.c
index 935b7e6ed..fdd29c4c8 100644
--- a/src/db/db_test.c
+++ b/src/db/db_test.c
@@ -699,8 +699,9 @@ int epicsShareAPI tpn(char *pname,char *pvalue)
return(-1);
}
ppn = calloc(1,sizeof(putNotify));
- if(!pdbaddr) {
+ if(!ppn) {
printf("calloc failed\n");
+ free((void *)pdbaddr);
return(-1);
}
ppn->paddr = pdbaddr;
@@ -708,13 +709,14 @@ int epicsShareAPI tpn(char *pname,char *pvalue)
ppn->nRequest = 1;
if(dbPutNotifyMapType(ppn,DBR_STRING)) {
printf("dbPutNotifyMapType failed\n");
- printf("calloc failed\n");
+ free((void *)pdbaddr);
return(-1);
}
ppn->userCallback = tpnCallback;
ptpnInfo = calloc(1,sizeof(tpnInfo));
if(!ptpnInfo) {
printf("calloc failed\n");
+ free((void *)pdbaddr);
return(-1);
}
ptpnInfo->ppn = ppn;
diff --git a/src/gdd/gddTest.cc b/src/gdd/gddTest.cc
index d36014018..881a55df9 100644
--- a/src/gdd/gddTest.cc
+++ b/src/gdd/gddTest.cc
@@ -308,7 +308,7 @@ void gdd::test()
pdd->convertOffsetsToAddress();
pdd->dump();
pdd->unreference();
- delete buf;
+ delete [] buf;
}
#endif
@@ -510,7 +510,7 @@ void gddContainer::test(void)
fprintf(stderr,"=====RE-DUMP OF ORIGINAL CONTAINER:\n");
dump();
cdd1->unreference();
- delete buf;
+ delete [] buf;
// test copy(), Dup(), copyInfo()
fprintf(stderr,"=======CREATING TEST CONTAINER FOR *COPY* TEST:\n");
diff --git a/src/libCom/osi/epicsGeneralTime.c b/src/libCom/osi/epicsGeneralTime.c
index 7c94b81d5..98c5566f7 100644
--- a/src/libCom/osi/epicsGeneralTime.c
+++ b/src/libCom/osi/epicsGeneralTime.c
@@ -378,7 +378,7 @@ static gtProvider * findProvider(ELLLIST *plist, epicsMutexId lock,
for (ptp = (gtProvider *)ellFirst(plist);
ptp; ptp = (gtProvider *)ellNext(&ptp->node)) {
- if (ptp->priority == ptp->priority &&
+ if (ptp->priority == priority &&
!strcmp(ptp->name, name))
break;
}
diff --git a/src/libCom/osi/os/RTEMS/osdMessageQueue.c b/src/libCom/osi/os/RTEMS/osdMessageQueue.c
index 3551e1e2f..4f57be318 100644
--- a/src/libCom/osi/os/RTEMS/osdMessageQueue.c
+++ b/src/libCom/osi/os/RTEMS/osdMessageQueue.c
@@ -167,7 +167,7 @@ static int receiveMessage(
return -1;
}
rsize = receiveMessage(id, id->localBuf, id->maxSize, wait, delay);
- if ((rsize < 0) || (rsize > size))
+ if (rsize > size)
return -1;
memcpy(buffer, id->localBuf, rsize);
}
diff --git a/src/libCom/osi/os/RTEMS/osdThread.c b/src/libCom/osi/os/RTEMS/osdThread.c
index 8c8363e77..27c1ebb60 100644
--- a/src/libCom/osi/os/RTEMS/osdThread.c
+++ b/src/libCom/osi/os/RTEMS/osdThread.c
@@ -404,8 +404,6 @@ void epicsThreadGetName (epicsThreadId id, char *name, size_t size)
struct taskVar *v;
int haveName = 0;
- if (size <= 0)
- return;
taskVarLock ();
for (v=taskVarHead ; v != NULL ; v=v->forw) {
if (v->id == tid) {
diff --git a/src/libCom/osi/os/WIN32/osdThread.c b/src/libCom/osi/os/WIN32/osdThread.c
index 5f61fc894..010eaf843 100644
--- a/src/libCom/osi/os/WIN32/osdThread.c
+++ b/src/libCom/osi/os/WIN32/osdThread.c
@@ -517,13 +517,8 @@ static win32ThreadParam * epicsThreadParmCreate ( const char *pName )
pParmWIN32 = calloc ( 1, sizeof ( *pParmWIN32 ) + strlen ( pName ) + 1 );
if ( pParmWIN32 ) {
- if ( pName ) {
- pParmWIN32->pName = (char *) ( pParmWIN32 + 1 );
- strcpy ( pParmWIN32->pName, pName );
- }
- else {
- pParmWIN32->pName = 0;
- }
+ pParmWIN32->pName = (char *) ( pParmWIN32 + 1 );
+ strcpy ( pParmWIN32->pName, pName );
pParmWIN32->isSuspended = 0;
}
return pParmWIN32;
diff --git a/src/makeBaseApp/top/caClientApp/caMonitor.c b/src/makeBaseApp/top/caClientApp/caMonitor.c
index 059fefb5e..9554cc744 100644
--- a/src/makeBaseApp/top/caClientApp/caMonitor.c
+++ b/src/makeBaseApp/top/caClientApp/caMonitor.c
@@ -109,6 +109,7 @@ int main(int argc,char **argv)
pmynode[npv] = callocMustSucceed(1, sizeof(MYNODE), "caMonitor");
npv++;
}
+ fclose(fp);
SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create");
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
"ca_add_exception_event");
diff --git a/src/rec/histogramRecord.c b/src/rec/histogramRecord.c
index 61a8b785e..5447b3b9f 100644
--- a/src/rec/histogramRecord.c
+++ b/src/rec/histogramRecord.c
@@ -134,8 +134,8 @@ static long wdogInit(histogramRecord *prec)
if(prec->wdog==NULL && prec->sdel>0) {
/* initialize a watchdog timer */
pcallback = (myCallback *)(calloc(1,sizeof(myCallback)));
+ if (!pcallback) return -1;
pcallback->prec = prec;
- if(!pcallback) return -1;
callbackSetCallback(wdogCallback,&pcallback->callback);
callbackSetUser(pcallback,&pcallback->callback);
callbackSetPriority(priorityLow,&pcallback->callback);
diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c
index 93c624298..b3eced22a 100644
--- a/src/rsrv/camessage.c
+++ b/src/rsrv/camessage.c
@@ -639,7 +639,7 @@ static void read_reply ( void *pArg, struct dbAddr *paddr,
static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *pClient )
{
struct channel_in_use *pciu = MPTOPCIU ( mp );
- const int readAccess = asCheckGet ( pciu->asClientPVT );
+ int readAccess;
ca_uint32_t payloadSize;
void *pPayload;
int status;
@@ -649,6 +649,7 @@ static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *p
logBadId ( pClient, mp, 0 );
return RSRV_ERROR;
}
+ readAccess = asCheckGet ( pciu->asClientPVT );
SEND_LOCK ( pClient );
diff --git a/src/util/iocLogServer.c b/src/util/iocLogServer.c
index f9deb06e5..f5694fc0f 100644
--- a/src/util/iocLogServer.c
+++ b/src/util/iocLogServer.c
@@ -84,131 +84,132 @@ static int sighupPipe[2];
/*
*
- * main()
+ * main()
*
*/
int main(void)
{
- struct sockaddr_in serverAddr; /* server's address */
- struct timeval timeout;
- int status;
- struct ioc_log_server *pserver;
+ struct sockaddr_in serverAddr; /* server's address */
+ struct timeval timeout;
+ int status;
+ struct ioc_log_server *pserver;
- osiSockIoctl_t optval;
+ osiSockIoctl_t optval;
- status = getConfig();
- if(status<0){
- fprintf(stderr, "iocLogServer: EPICS environment underspecified\n");
- fprintf(stderr, "iocLogServer: failed to initialize\n");
- return IOCLS_ERROR;
- }
+ status = getConfig();
+ if (status<0) {
+ fprintf(stderr, "iocLogServer: EPICS environment underspecified\n");
+ fprintf(stderr, "iocLogServer: failed to initialize\n");
+ return IOCLS_ERROR;
+ }
- pserver = (struct ioc_log_server *)
- calloc(1, sizeof *pserver);
- if(!pserver){
- fprintf(stderr, "iocLogServer: %s\n", strerror(errno));
- return IOCLS_ERROR;
- }
+ pserver = (struct ioc_log_server *)
+ calloc(1, sizeof *pserver);
+ if (!pserver) {
+ fprintf(stderr, "iocLogServer: %s\n", strerror(errno));
+ return IOCLS_ERROR;
+ }
- pserver->pfdctx = (void *) fdmgr_init();
- if(!pserver->pfdctx){
- fprintf(stderr, "iocLogServer: %s\n", strerror(errno));
- return IOCLS_ERROR;
- }
+ pserver->pfdctx = (void *) fdmgr_init();
+ if (!pserver->pfdctx) {
+ fprintf(stderr, "iocLogServer: %s\n", strerror(errno));
+ return IOCLS_ERROR;
+ }
- /*
- * Open the socket. Use ARPA Internet address format and stream
- * sockets. Format described in .
- */
- pserver->sock = epicsSocketCreate(AF_INET, SOCK_STREAM, 0);
- if (pserver->sock==INVALID_SOCKET) {
+ /*
+ * Open the socket. Use ARPA Internet address format and stream
+ * sockets. Format described in .
+ */
+ pserver->sock = epicsSocketCreate(AF_INET, SOCK_STREAM, 0);
+ if (pserver->sock == INVALID_SOCKET) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- fprintf(stderr, "iocLogServer: sock create err: %s\n", sockErrBuf);
- return IOCLS_ERROR;
- }
-
+ fprintf(stderr, "iocLogServer: sock create err: %s\n", sockErrBuf);
+ free(pserver);
+ return IOCLS_ERROR;
+ }
+
epicsSocketEnableAddressReuseDuringTimeWaitState ( pserver->sock );
- /* Zero the sock_addr structure */
- memset((void *)&serverAddr, 0, sizeof serverAddr);
- serverAddr.sin_family = AF_INET;
- serverAddr.sin_port = htons(ioc_log_port);
+ /* Zero the sock_addr structure */
+ memset((void *)&serverAddr, 0, sizeof serverAddr);
+ serverAddr.sin_family = AF_INET;
+ serverAddr.sin_port = htons(ioc_log_port);
- /* get server's Internet address */
- status = bind ( pserver->sock,
- (struct sockaddr *)&serverAddr,
- sizeof (serverAddr) );
- if (status<0) {
+ /* get server's Internet address */
+ status = bind ( pserver->sock,
+ (struct sockaddr *)&serverAddr,
+ sizeof (serverAddr) );
+ if (status < 0) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- fprintf(stderr, "iocLogServer: bind err: %s\n", sockErrBuf );
- fprintf (stderr,
- "iocLogServer: a server is already installed on port %u?\n",
- (unsigned)ioc_log_port);
- return IOCLS_ERROR;
- }
+ fprintf(stderr, "iocLogServer: bind err: %s\n", sockErrBuf );
+ fprintf (stderr,
+ "iocLogServer: a server is already installed on port %u?\n",
+ (unsigned)ioc_log_port);
+ return IOCLS_ERROR;
+ }
- /* listen and accept new connections */
- status = listen(pserver->sock, 10);
- if (status<0) {
+ /* listen and accept new connections */
+ status = listen(pserver->sock, 10);
+ if (status < 0) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- fprintf(stderr, "iocLogServer: listen err %s\n", sockErrBuf);
- return IOCLS_ERROR;
- }
+ fprintf(stderr, "iocLogServer: listen err %s\n", sockErrBuf);
+ return IOCLS_ERROR;
+ }
- /*
- * Set non blocking IO
- * to prevent dead locks
- */
- optval = TRUE;
- status = socket_ioctl(
- pserver->sock,
- FIONBIO,
- &optval);
- if(status<0){
+ /*
+ * Set non blocking IO
+ * to prevent dead locks
+ */
+ optval = TRUE;
+ status = socket_ioctl(
+ pserver->sock,
+ FIONBIO,
+ &optval);
+ if (status < 0){
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- fprintf(stderr, "iocLogServer: ioctl FIONBIO err %s\n", sockErrBuf);
- return IOCLS_ERROR;
- }
+ fprintf(stderr, "iocLogServer: ioctl FIONBIO err %s\n", sockErrBuf);
+ return IOCLS_ERROR;
+ }
-# ifdef UNIX
- status = setupSIGHUP(pserver);
- if (status<0) {
- return IOCLS_ERROR;
- }
-# endif
+# ifdef UNIX
+ status = setupSIGHUP(pserver);
+ if (status < 0) {
+ return IOCLS_ERROR;
+ }
+# endif
- status = openLogFile(pserver);
- if (status<0) {
- fprintf(stderr,
- "File access problems to `%s' because `%s'\n",
- ioc_log_file_name,
- strerror(errno));
- return IOCLS_ERROR;
- }
+ status = openLogFile(pserver);
+ if (status < 0) {
+ fprintf(stderr,
+ "File access problems to `%s' because `%s'\n",
+ ioc_log_file_name,
+ strerror(errno));
+ return IOCLS_ERROR;
+ }
- status = fdmgr_add_callback(
- pserver->pfdctx,
- pserver->sock,
- fdi_read,
- acceptNewClient,
- pserver);
- if(status<0){
- fprintf(stderr,
- "iocLogServer: failed to add read callback\n");
- return IOCLS_ERROR;
- }
+ status = fdmgr_add_callback(
+ pserver->pfdctx,
+ pserver->sock,
+ fdi_read,
+ acceptNewClient,
+ pserver);
+ if (status < 0) {
+ fprintf(stderr,
+ "iocLogServer: failed to add read callback\n");
+ return IOCLS_ERROR;
+ }
- while(TRUE){
- timeout.tv_sec = 60; /* 1 min */
- timeout.tv_usec = 0;
- fdmgr_pend_event(pserver->pfdctx, &timeout);
- fflush(pserver->poutfile);
- }
+ while (TRUE) {
+ timeout.tv_sec = 60; /* 1 min */
+ timeout.tv_usec = 0;
+ fdmgr_pend_event(pserver->pfdctx, &timeout);
+ fflush(pserver->poutfile);
+ }
}
/*
@@ -964,6 +965,7 @@ static int getDirectory(void)
"Problem reading o/p from `%s' because `%s'\n",
ioc_log_file_command,
strerror(errno));
+ (void) pclose(pipe);
return IOCLS_ERROR;
}
(void) pclose(pipe);
From 63b059c35e4b95c2a50059f403d8709cf7742b40 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 7 Dec 2016 17:51:00 -0600
Subject: [PATCH 54/70] Resolve additional cppcheck issues; fix iOS build
---
src/ioc/db/db_test.c | 1 +
src/ioc/rsrv/camessage.c | 1 +
src/libCom/iocsh/iocsh.cpp | 2 ++
src/libCom/test/epicsEventTest.cpp | 7 +++++++
src/libCom/test/epicsMutexTest.cpp | 6 ++++++
src/libCom/test/ringBytesTest.c | 4 ++++
6 files changed, 21 insertions(+)
diff --git a/src/ioc/db/db_test.c b/src/ioc/db/db_test.c
index bc9ac32a8..8d7ad31b1 100644
--- a/src/ioc/db/db_test.c
+++ b/src/ioc/db/db_test.c
@@ -243,6 +243,7 @@ int tpn(const char *pname, const char *pvalue)
ptpnInfo = calloc(1, sizeof(tpnInfo));
if (!ptpnInfo) {
printf("calloc failed\n");
+ free(ppn);
dbChannelDelete(chan);
return -1;
}
diff --git a/src/ioc/rsrv/camessage.c b/src/ioc/rsrv/camessage.c
index 057731777..b13883b5a 100644
--- a/src/ioc/rsrv/camessage.c
+++ b/src/ioc/rsrv/camessage.c
@@ -26,6 +26,7 @@
#include "epicsEvent.h"
#include "epicsMutex.h"
#include "epicsStdio.h"
+#include "epicsString.h"
#include "epicsThread.h"
#include "epicsTime.h"
#include "errlog.h"
diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp
index d8701532e..21253bbc9 100644
--- a/src/libCom/iocsh/iocsh.cpp
+++ b/src/libCom/iocsh/iocsh.cpp
@@ -559,6 +559,7 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
if (macros) {
if (macParseDefns(NULL, macros, &defines) < 0) {
+ free(redirects);
return -1;
}
}
@@ -571,6 +572,7 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
if (handle == NULL) {
if (macCreateHandle(&handle, pairs)) {
errlogMessage("iocsh: macCreateHandle failed.");
+ free(redirects);
return -1;
}
diff --git a/src/libCom/test/epicsEventTest.cpp b/src/libCom/test/epicsEventTest.cpp
index b0d79613f..7c1a24141 100644
--- a/src/libCom/test/epicsEventTest.cpp
+++ b/src/libCom/test/epicsEventTest.cpp
@@ -250,5 +250,12 @@ MAIN(epicsEventTest)
eventWaitTest();
eventWakeupTest();
+ free(name);
+ free(id);
+ epicsRingPointerDelete(pinfo->ring);
+ epicsMutexDestroy(pinfo->lockRing);
+ epicsEventDestroy(event);
+ free(pinfo);
+
return testDone();
}
diff --git a/src/libCom/test/epicsMutexTest.cpp b/src/libCom/test/epicsMutexTest.cpp
index 87cf0a460..d44e5c0f1 100644
--- a/src/libCom/test/epicsMutexTest.cpp
+++ b/src/libCom/test/epicsMutexTest.cpp
@@ -279,5 +279,11 @@ MAIN(epicsMutexTest)
epicsMutexPerformance ();
+ free(pinfo);
+ free(arg);
+ free(name);
+ free(id);
+ epicsMutexDestroy(mutex);
+
return testDone();
}
diff --git a/src/libCom/test/ringBytesTest.c b/src/libCom/test/ringBytesTest.c
index ecfd991be..6cef93334 100644
--- a/src/libCom/test/ringBytesTest.c
+++ b/src/libCom/test/ringBytesTest.c
@@ -115,5 +115,9 @@ MAIN(ringBytesTest)
testOk(n==1, "ring get %d", 1);
check(ring, RINGSIZE);
+ epicsRingBytesDelete(ring);
+ epicsEventDestroy(consumerEvent);
+ free(pinfo);
+
return testDone();
}
From 1cb75ebb6e054801bb922b7e20b156e720e98d1b Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 8 Dec 2016 13:57:23 -0600
Subject: [PATCH 55/70] asLib message buffer too small (Freddie Akeroyd)
---
src/as/asLib_lex.l | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/as/asLib_lex.l b/src/as/asLib_lex.l
index 90e1b55bb..5e0451925 100644
--- a/src/as/asLib_lex.l
+++ b/src/as/asLib_lex.l
@@ -68,7 +68,7 @@ INP{link} {
\n { line_num ++;}
. {
- char message[20];
+ char message[40];
YY_BUFFER_STATE *dummy=0;
sprintf(message,"invalid character '%c'",yytext[0]);
From 8d7bf52e515af8736fc8777b914d3b5681f0fce0 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 9 Dec 2016 11:17:43 -0600
Subject: [PATCH 56/70] One more cppcheck issue fixed
---
src/dbStatic/dbLexRoutines.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/dbStatic/dbLexRoutines.c b/src/dbStatic/dbLexRoutines.c
index 78a3cc39c..db95cc61f 100644
--- a/src/dbStatic/dbLexRoutines.c
+++ b/src/dbStatic/dbLexRoutines.c
@@ -229,24 +229,25 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
}
}
pinputFile = dbCalloc(1,sizeof(inputFile));
- if(filename) {
- pinputFile->filename = macEnvExpand(filename);
+ if (filename) {
+ pinputFile->filename = macEnvExpand(filename);
}
- if(!fp) {
- FILE *fp1;
+ if (!fp) {
+ FILE *fp1 = 0;
- if(pinputFile->filename) pinputFile->path = dbOpenFile(pdbbase,pinputFile->filename,&fp1);
- if(!pinputFile->filename || !fp1) {
- errPrintf(0,__FILE__, __LINE__,
- "dbRead opening file %s",pinputFile->filename);
- free((void *)pinputFile->filename);
- free((void *)pinputFile);
+ if (pinputFile->filename)
+ pinputFile->path = dbOpenFile(pdbbase, pinputFile->filename, &fp1);
+ if (!pinputFile->filename || !fp1) {
+ errPrintf(0, __FILE__, __LINE__,
+ "dbRead opening file %s",pinputFile->filename);
+ free(pinputFile->filename);
+ free(pinputFile);
status = -1;
goto cleanup;
- }
- pinputFile->fp = fp1;
+ }
+ pinputFile->fp = fp1;
} else {
- pinputFile->fp = fp;
+ pinputFile->fp = fp;
}
pinputFile->line_num = 0;
pinputFileNow = pinputFile;
From 5097ac32301b5fe875c73e7754058bd58c586de4 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 9 Dec 2016 13:48:55 -0600
Subject: [PATCH 57/70] Set SNAPSHOT for 3.14.12.6
---
configure/CONFIG_BASE_VERSION | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index decbf9280..8a8b9610b 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -37,10 +37,10 @@ EPICS_PATCH_LEVEL = 6
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
#EPICS_DEV_SNAPSHOT=-rc1
-EPICS_DEV_SNAPSHOT=-rc1-DEV
+#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
-#EPICS_DEV_SNAPSHOT=
+EPICS_DEV_SNAPSHOT=
# No changes should be needed below here
From 260bc64b59422d7cbb4280ada64bf6461ce2d425 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 9 Dec 2016 13:50:17 -0600
Subject: [PATCH 58/70] Set SNAPSHOT back to -DEV
---
configure/CONFIG_BASE_VERSION | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 8a8b9610b..e5f7e58b4 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -31,7 +31,7 @@ EPICS_MODIFICATION = 12
EPICS_PATCH_LEVEL = 6
# This will end in -DEV between official releases
-#EPICS_DEV_SNAPSHOT=-DEV
+EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
@@ -40,7 +40,7 @@ EPICS_PATCH_LEVEL = 6
#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
-EPICS_DEV_SNAPSHOT=
+#EPICS_DEV_SNAPSHOT=
# No changes should be needed below here
From fd53e175b49cfa8601cccf60f0e63c5d65f250c1 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Tue, 13 Dec 2016 14:25:23 +0100
Subject: [PATCH 59/70] Update CONFIG_BASE_VERSION for 3.15.5, remove "not
released" from RELEASE_NOTES
---
configure/CONFIG_BASE_VERSION | 4 ++--
documentation/RELEASE_NOTES.html | 3 ---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index d87d48baf..146259312 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -40,10 +40,10 @@ EPICS_PATCH_LEVEL = 0
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
#EPICS_DEV_SNAPSHOT=-rc1
-EPICS_DEV_SNAPSHOT=-rc1-DEV
+#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
-#EPICS_DEV_SNAPSHOT=
+EPICS_DEV_SNAPSHOT=
# No changes should be needed below here
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index c08020d3e..565447581 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -9,9 +9,6 @@
EPICS Base Release 3.15.5
-This version of EPICS Base has not been released yet.
-
-
Changes made on the 3.15 branch since 3.15.4
From eff44268e9144e204a20fc9d1284703e86c451b9 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Tue, 13 Dec 2016 15:33:01 +0100
Subject: [PATCH 60/70] Set version to 3.15.5-DEV, close 3.15.5 chapter in
release notes
---
configure/CONFIG_BASE_VERSION | 4 ++--
documentation/RELEASE_NOTES.html | 20 +++++++++++++-------
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index 146259312..1e60b2740 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -34,7 +34,7 @@ EPICS_MODIFICATION = 5
EPICS_PATCH_LEVEL = 0
# This will end in -DEV between official releases
-#EPICS_DEV_SNAPSHOT=-DEV
+EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
@@ -43,7 +43,7 @@ EPICS_PATCH_LEVEL = 0
#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
-EPICS_DEV_SNAPSHOT=
+#EPICS_DEV_SNAPSHOT=
# No changes should be needed below here
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 565447581..117acc456 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -3,15 +3,25 @@
- EPICS Base R3.15.5 Release Notes
+ EPICS Base R3.15.6 Release Notes
-EPICS Base Release 3.15.5
+EPICS Base Release 3.15.6
-Changes made on the 3.15 branch since 3.15.4
+This version of EPICS Base has not been released yet.
+
+
+Changes made on the 3.15 branch since 3.15.5
+
+Changes from the 3.14 branch since 3.15.5
+
+
+
+Changes between 3.15.4 and 3.15.5
+
dbStatic Library Speedup and Cleanup
Loading of database files has been optimized to avoid overproportionally
@@ -25,10 +35,6 @@ old behavior.
to be used by database configuration tools linked against a host side version
of the dbStatic library that is not being built anymore.
-
-Changes from the 3.14 branch since 3.15.4
-
-
Launchpad Bug-fixes
In addition to the more detailed change descriptions below, the following
From 7ec6be5d14a5814470f84b3557989a18942bc598 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 13 Dec 2016 17:03:54 -0600
Subject: [PATCH 61/70] Update version numbers in documents for 3.15.6
---
documentation/KnownProblems.html | 8 ++--
documentation/README.1st | 2 +-
documentation/README.html | 2 +-
documentation/ReleaseChecklist.html | 72 ++++++++++++++---------------
4 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/documentation/KnownProblems.html b/documentation/KnownProblems.html
index 5dfc280db..f32006846 100644
--- a/documentation/KnownProblems.html
+++ b/documentation/KnownProblems.html
@@ -4,17 +4,17 @@
- Known Problems in R3.15.5
+ Known Problems in R3.15.6
-EPICS Base R3.15.5: Known Problems
+EPICS Base R3.15.6: Known Problems
Any patch files linked below should be applied at the root of the
-base-3.15.5 tree. Download them, then use the GNU Patch program as
+base-3.15.6 tree. Download them, then use the GNU Patch program as
follows:
-% cd /path/to/base-3.15.5
+% cd /path/to/base-3.15.6
% patch -p0 < /path/to/file.patch
The following significant problems have been reported with this
diff --git a/documentation/README.1st b/documentation/README.1st
index 8349d445c..3122bdfbd 100644
--- a/documentation/README.1st
+++ b/documentation/README.1st
@@ -1,6 +1,6 @@
Installation Instructions
- EPICS Base Release 3.15.5
+ EPICS Base Release 3.15.6
--------------------------------------------------------------------------
diff --git a/documentation/README.html b/documentation/README.html
index eef83ed58..fadca3d11 100644
--- a/documentation/README.html
+++ b/documentation/README.html
@@ -9,7 +9,7 @@
Installation Instructions
-EPICS Base Release 3.15.5
+EPICS Base Release 3.15.6
Table of Contents
diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html
index 77917b99e..4b9b55c4b 100644
--- a/documentation/ReleaseChecklist.html
+++ b/documentation/ReleaseChecklist.html
@@ -41,11 +41,12 @@ that should be performed when creating new releases of EPICS Base.
pre-release, -pre1. The first Release Candidate -rc1 is the
first version that has undergone widespread testing and which has no known
problems in it that are slated to be fixed in this release. New versions should
-be made at about weekly intervals during the testing and debugging period, and
-will be designated as either pre-release versions or Release Candidates by the
-Release Manager. A Release Candidate that has received widespread testing for a
-week without any additional problems being discovered or significant changes
-being committed can be designated as the final release version.
+be made at 2-weekly intervals during the testing and debugging period, and will
+be designated as either pre-release versions or Release Candidates by the
+Release Manager. After a Release Candidate has been available to the whole
+community for testing for at least a week without any additional problems being
+reported or significant changes being committed, the branch can be designated as
+the final release version.
Roles
@@ -56,7 +57,7 @@ relevent roles unless the Release Manager designates otherwise:
- Release Manager (Ralph Lange)
- Responsible for managing and tagging the release
- - Platform Developers
+ - Platform Developers (optional)
- Responsible for individual operating system platforms
- Application Developers
- Responsible for support modules that depend on EPICS Base.
@@ -135,17 +136,17 @@ relevent roles unless the Release Manager designates otherwise:
Tag the module in Bazaar, using these tag conventions:
-
- R3.15.5-pren
+ R3.15.6-pre1
— pre-release tag
-
- R3.15.5-rcn
- — release candidate tag, note the rc is now
- lower-case
+ R3.15.6-rc1
+ — release candidate tag
+
cd ~/base/mirror-3.15
- bzr tag R3.15.5-rcn
+ bzr tag R3.15.6-rc1
|
@@ -157,14 +158,14 @@ relevent roles unless the Release Manager designates otherwise:
cd ~/base
bzr export
- --root=base-3.15.5-rcn
- -r tag:R3.15.5-rcn
- base-3.15.5-rcn.tar.gz
+ --root=base-3.15.6-rc1
+ -r tag:R3.15.6-rc1
+ base-3.15.6-rc1.tar.gz
mirror-3.15
Create a GPG signature file of the tarfile as follows:
- gpg --armor --sign --detach-sig base-3.15.5-rcn.tar.gz
+ gpg --armor --sign --detach-sig base-3.15.6-rc1.tar.gz
@@ -276,7 +277,7 @@ relevent roles unless the Release Manager designates otherwise:
Tag the module in Bazaar:
cd ~/base/mirror-3.15
- bzr tag R3.15.5
+ bzr tag R3.15.6
|
@@ -288,14 +289,14 @@ relevent roles unless the Release Manager designates otherwise:
cd ~/base
bzr export
- --root=base-3.15.5
- -r tag:R3.15.5
- base-3.15.5.tar.gz
+ --root=base-3.15.6
+ -r tag:R3.15.6
+ base-3.15.6.tar.gz
mirror-3.15
Create a GPG signature file of the tarfile as follows:
- gpg --armor --sign --detach-sig base-3.15.5.tar.gz
+ gpg --armor --sign --detach-sig base-3.15.6.tar.gz
@@ -305,14 +306,24 @@ relevent roles unless the Release Manager designates otherwise:
Test the tar file by extracting its contents and building it on at
least one supported platform |
+
+ | |
+ Release Manager |
+ Upload the release tar file to the Launchpad download area. |
+
+
+ | |
+ Release Manager |
+ Find all Launchpad bug reports with the status Fix Committed which
+ have been fixed in this release and mark them Fix Released. |
+
| Publish and Announce it |
| |
Website Manager |
- If necessary recreate the tarfile following the instructions above.
- Copy the tar file and its .asc signature file to the Base
+ | Copy the tar file and its .asc signature file to the Base
download area of the website. |
@@ -343,24 +354,13 @@ relevent roles unless the Release Manager designates otherwise:
| |
Website Manager |
- Upload the release tar file to the Launchpad download area. |
-
-
- | |
- Website Manager |
- Find all Launchpad bug reports with the status Fix Committed which
- have been fixed in this release and mark them Fix Released. |
+ Add an entry to the website News page, linking to the new version
+ webpage. |
| |
Release Manager |
- Email tech-talk |
-
-
- | |
- Website Manager |
- Add an entry to the website News page, linking to the new version
- webpage. |
+ Announce the release on the tech-talk mailing list. |
From 20dda339cc5ed3727b09abdb619cbdbb452beeac Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 4 Jan 2017 16:32:13 -0600
Subject: [PATCH 62/70] Make *_INC files order-only prerequisites
---
configure/RULES_BUILD | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
index 978d616e5..eca015ca7 100644
--- a/configure/RULES_BUILD
+++ b/configure/RULES_BUILD
@@ -207,17 +207,18 @@ $(OBJLIBNAME):%$(OBJ):
%.o : %.cc
%.o : %.cpp
-%$(OBJ): %.c $(COMMON_INC) $(INSTALL_INC)
+# Include files are order-only prerequisites for compilation:
+%$(OBJ): %.c | $(COMMON_INC) $(INSTALL_INC)
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.c) $(call PATH_FILTER,$<) $(COMPILE_FILTER.c)
-%$(OBJ): %.cc $(COMMON_INC) $(INSTALL_INC)
+%$(OBJ): %.cc | $(COMMON_INC) $(INSTALL_INC)
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.cpp) $(call PATH_FILTER,$<) $(COMPILE_FILTER.cpp)
-%$(OBJ): %.cpp $(COMMON_INC) $(INSTALL_INC)
+%$(OBJ): %.cpp | $(COMMON_INC) $(INSTALL_INC)
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.cpp) $(call PATH_FILTER,$<) $(COMPILE_FILTER.cpp)
From 4a0fd0b954d41329069c1bb19060c273967f91eb Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 5 Jan 2017 14:09:03 -0600
Subject: [PATCH 63/70] Fix error message
---
src/tools/DBD/Recordtype.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tools/DBD/Recordtype.pm b/src/tools/DBD/Recordtype.pm
index 8c8fabbae..e4b0d5481 100644
--- a/src/tools/DBD/Recordtype.pm
+++ b/src/tools/DBD/Recordtype.pm
@@ -106,7 +106,7 @@ sub equals {
my ($new, $known) = @_;
return 0 if ! $known->fields;
return 1 if ! $new->fields;
- dieContext("Duplicate definition of record type '$a->{NAME}'");
+ dieContext("Duplicate definition of record type '$known->{NAME}'");
}
sub toDeclaration {
From 49e0e23f760bdbbc938d245ae3b74b0239b9ec6c Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 6 Jan 2017 15:38:03 -0600
Subject: [PATCH 64/70] Better protection against bad periodic scan rates
---
documentation/RELEASE_NOTES.html | 20 +++++--
src/db/dbScan.c | 93 ++++++++++++++++++++++----------
2 files changed, 81 insertions(+), 32 deletions(-)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index dc0fdcdb3..98913581e 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -3,16 +3,28 @@
- EPICS Base R3.14.12.6 Release Notes
+ EPICS Base R3.14.12.7 Release Notes
-EPICS Base Release 3.14.12.6
+EPICS Base Release 3.14.12.7
-Changes between 3.14.12.5 and 3.14.12.6
+Changes between 3.14.12.6 and 3.14.12.7
+Checking Periodic Scan Rates
+
+Code has been added to the IOC startup to better protect it against bad
+periodic scan rates, including against locales where .
is not
+accepted as a decimal separator character. If the scan period in a menuScan
+choice string cannot be parsed, the associated periodic scan thread will no
+longer be started by the IOC and a warning message will be displayed at iocInit
+time. The scanppl command will also flag the faulty menuScan value.
+
+
+Changes between 3.14.12.5 and 3.14.12.6
+
Launchpad Bug-fixes
In addition to the more detailed change descriptions below, the following
@@ -277,8 +289,6 @@ it up. This release patches the readline support code to clean up automatically
by registering an epicsAtExit() routine.
-EPICS Base Release 3.14.12.5
-
Changes between 3.14.12.4 and 3.14.12.5
aoRecord raw conversion overflows
diff --git a/src/db/dbScan.c b/src/db/dbScan.c
index f764a1760..fb13cb0c3 100644
--- a/src/db/dbScan.c
+++ b/src/db/dbScan.c
@@ -148,8 +148,11 @@ static void scanShutdown(void *arg)
interruptAccept = FALSE;
for (i = 0; i < nPeriodic; i++) {
- papPeriodic[i]->scanCtl = ctlExit;
- epicsEventSignal(papPeriodic[i]->loopEvent);
+ periodic_scan_list *ppsl = papPeriodic[i];
+
+ if (!ppsl) continue;
+ ppsl->scanCtl = ctlExit;
+ epicsEventSignal(ppsl->loopEvent);
epicsEventWait(startStopEvent);
}
@@ -182,16 +185,24 @@ void scanRun(void)
interruptAccept = TRUE;
scanCtl = ctlRun;
- for (i = 0; i < nPeriodic; i++)
- papPeriodic[i]->scanCtl = ctlRun;
+ for (i = 0; i < nPeriodic; i++) {
+ periodic_scan_list *ppsl = papPeriodic[i];
+
+ if (!ppsl) continue;
+ ppsl->scanCtl = ctlRun;
+ }
}
void scanPause(void)
{
int i;
- for (i = nPeriodic - 1; i >= 0; --i)
- papPeriodic[i]->scanCtl = ctlPause;
+ for (i = nPeriodic - 1; i >= 0; --i) {
+ periodic_scan_list *ppsl = papPeriodic[i];
+
+ if (!ppsl) continue;
+ ppsl->scanCtl = ctlPause;
+ }
scanCtl = ctlPause;
interruptAccept = FALSE;
@@ -275,9 +286,11 @@ void scanAdd(struct dbCommon *precord)
piosl += prio; /* get piosl for correct priority*/
addToList(precord, &piosl->scan_list);
} else if (scan >= SCAN_1ST_PERIODIC) {
- addToList(precord, &papPeriodic[scan - SCAN_1ST_PERIODIC]->scan_list);
+ periodic_scan_list *ppsl = papPeriodic[scan - SCAN_1ST_PERIODIC];
+
+ if (ppsl)
+ addToList(precord, &ppsl->scan_list);
}
- return;
}
void scanDelete(struct dbCommon *precord)
@@ -348,28 +361,48 @@ void scanDelete(struct dbCommon *precord)
piosl += prio; /*get piosl for correct priority*/
deleteFromList(precord, &piosl->scan_list);
} else if (scan >= SCAN_1ST_PERIODIC) {
- deleteFromList(precord, &papPeriodic[scan - SCAN_1ST_PERIODIC]->scan_list);
+ periodic_scan_list *ppsl = papPeriodic[scan - SCAN_1ST_PERIODIC];
+
+ if (ppsl)
+ deleteFromList(precord, &ppsl->scan_list);
}
- return;
}
double scanPeriod(int scan) {
+ periodic_scan_list *ppsl;
+
scan -= SCAN_1ST_PERIODIC;
if (scan < 0 || scan >= nPeriodic)
return 0.0;
- return papPeriodic[scan]->period;
+ ppsl = papPeriodic[scan];
+ return ppsl ? ppsl->period : 0.0;
}
-
-int scanppl(double period) /* print periodic list */
+
+int scanppl(double period) /* print periodic scan list(s) */
{
- periodic_scan_list *ppsl;
+ dbMenu *pmenu = dbFindMenu(pdbbase, "menuScan");
char message[80];
int i;
+ if (!pmenu || !papPeriodic) {
+ printf("scanppl: dbScan subsystem not initialized\n");
+ return -1;
+ }
+
for (i = 0; i < nPeriodic; i++) {
- ppsl = papPeriodic[i];
- if (ppsl == NULL) continue;
- if (period > 0.0 && (fabs(period - ppsl->period) >.05)) continue;
+ periodic_scan_list *ppsl = papPeriodic[i];
+
+ if (!ppsl) {
+ const char *choice = pmenu->papChoiceValue[i + SCAN_1ST_PERIODIC];
+
+ printf("Periodic scan list for SCAN = '%s' not initialized\n",
+ choice);
+ continue;
+ }
+ if (period > 0.0 &&
+ (fabs(period - ppsl->period) > 0.05))
+ continue;
+
sprintf(message, "Records with SCAN = '%s' (%lu over-runs):",
ppsl->name, ppsl->overruns);
printList(&ppsl->scan_list, message);
@@ -588,7 +621,7 @@ static void periodicTask(void *arg)
if (++overruns >= 10 &&
epicsTimeDiffInSeconds(&now, &reported) > report_delay) {
errlogPrintf("\ndbScan warning from '%s' scan thread:\n"
- "\tScan processing averages %.2f seconds (%.2f .. %.2f).\n"
+ "\tScan processing averages %.3f seconds (%.3f .. %.3f).\n"
"\tOver-runs have now happened %u times in a row.\n"
"\tTo fix this, move some records to a slower scan rate.\n",
ppsl->name, ppsl->period + overtime / overruns,
@@ -617,25 +650,30 @@ static void periodicTask(void *arg)
static void initPeriodic(void)
{
- dbMenu *pmenu;
- periodic_scan_list *ppsl;
+ dbMenu *pmenu = dbFindMenu(pdbbase, "menuScan");
int i;
- pmenu = dbFindMenu(pdbbase, "menuScan");
if (!pmenu) {
- epicsPrintf("initPeriodic: menuScan not present\n");
+ errlogPrintf("initPeriodic: menuScan not present\n");
return;
}
nPeriodic = pmenu->nChoice - SCAN_1ST_PERIODIC;
papPeriodic = dbCalloc(nPeriodic, sizeof(periodic_scan_list*));
periodicTaskId = dbCalloc(nPeriodic, sizeof(void *));
for (i = 0; i < nPeriodic; i++) {
- ppsl = dbCalloc(1, sizeof(periodic_scan_list));
+ periodic_scan_list *ppsl = dbCalloc(1, sizeof(periodic_scan_list));
+ const char *choice = pmenu->papChoiceValue[i + SCAN_1ST_PERIODIC];
+
+ if (!epicsScanDouble(choice, &ppsl->period) ||
+ ppsl->period <= 0) {
+ errlogPrintf("initPeriodic: Bad menuScan choice '%s'\n", choice);
+ free(ppsl);
+ continue;
+ }
ppsl->scan_list.lock = epicsMutexMustCreate();
ellInit(&ppsl->scan_list.list);
- ppsl->name = pmenu->papChoiceValue[i + SCAN_1ST_PERIODIC];
- epicsScanDouble(ppsl->name, &ppsl->period);
+ ppsl->name = choice;
ppsl->scanCtl = ctlPause;
ppsl->loopEvent = epicsEventMustCreate(epicsEventEmpty);
@@ -645,10 +683,11 @@ static void initPeriodic(void)
static void spawnPeriodic(int ind)
{
- periodic_scan_list *ppsl;
+ periodic_scan_list *ppsl = papPeriodic[ind];
char taskName[20];
- ppsl = papPeriodic[ind];
+ if (!ppsl) return;
+
sprintf(taskName, "scan%g", ppsl->period);
periodicTaskId[ind] = epicsThreadCreate(
taskName, epicsThreadPriorityScanLow + ind,
From 7310d7805712f4ce4d82c6fe8c23c9b8efba11d6 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 16 Jan 2017 10:46:56 -0600
Subject: [PATCH 65/70] Prepend to PATH, not append
---
src/tools/convertRelease.pl | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl
index 937f9ad5d..fd6a527c5 100644
--- a/src/tools/convertRelease.pl
+++ b/src/tools/convertRelease.pl
@@ -5,7 +5,7 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
-# in file LICENSE that is included with this distribution.
+# in file LICENSE that is included with this distribution.
#*************************************************************************
#
# Convert configure/RELEASE file(s) into something else.
@@ -119,15 +119,15 @@ sub dllPath {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
print OUT "\@ECHO OFF\n";
- print OUT "PATH \%PATH\%;", join(';', binDirs()), "\n";
+ print OUT "PATH ", join(';', binDirs(), '%PATH%'), "\n";
close OUT;
}
sub relPaths {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
- print OUT "export PATH=\$PATH:",
- join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs()), "\n";
+ print OUT "export PATH=",
+ join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs(), '$PATH'), "\n";
close OUT;
}
@@ -150,22 +150,22 @@ sub binDirs {
sub cdCommands {
die "Architecture not set (use -a option)" unless ($arch);
my @includes = grep !m/^(RULES | TEMPLATE_TOP)$/x, @apps;
-
+
unlink($outfile);
open(OUT,">$outfile") or die "$! creating $outfile";
-
+
my $startup = $cwd;
$startup =~ s/^$root/$iocroot/o if ($opt_t);
$startup =~ s/([\\"])/\\\1/g; # escape back-slashes and double-quotes
-
+
print OUT "startup = \"$startup\"\n";
-
+
my $ioc = $cwd;
$ioc =~ s/^.*\///; # iocname is last component of directory name
-
+
print OUT "putenv(\"ARCH=$arch\")\n";
print OUT "putenv(\"IOC=$ioc\")\n";
-
+
foreach my $app (@includes) {
my $iocpath = my $path = $macros{$app};
$iocpath =~ s/^$root/$iocroot/o if ($opt_t);
@@ -188,16 +188,16 @@ sub cdCommands {
sub envPaths {
die "Architecture not set (use -a option)" unless ($arch);
my @includes = grep !m/^ (RULES | TEMPLATE_TOP) $/x, @apps;
-
+
unlink($outfile);
open(OUT,">$outfile") or die "$! creating $outfile";
-
+
my $ioc = $cwd;
$ioc =~ s/^.*\///; # iocname is last component of directory name
-
+
print OUT "epicsEnvSet(\"ARCH\",\"$arch\")\n";
print OUT "epicsEnvSet(\"IOC\",\"$ioc\")\n";
-
+
foreach my $app (@includes) {
my $iocpath = my $path = $macros{$app};
$iocpath =~ s/^$root/$iocroot/o if ($opt_t);
@@ -224,7 +224,7 @@ sub checkRelease {
expandRelease(\%check, \@order);
delete $check{TOP};
delete $check{EPICS_HOST_ARCH};
-
+
while (my ($parent, $ppath) = each %check) {
if (exists $macros{$parent} &&
AbsPath($macros{$parent}) ne AbsPath($ppath)) {
@@ -269,4 +269,3 @@ sub checkRelease {
print "\n" if $status;
exit $status;
}
-
From b9ae6c3308f105a2a0b6532616501ae30ff12dc9 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 18 Jan 2017 10:59:36 -0600
Subject: [PATCH 66/70] Allow ARCH with trailing spaces
---
configure/RULES.ioc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/configure/RULES.ioc b/configure/RULES.ioc
index 1024fcb22..4795bc515 100644
--- a/configure/RULES.ioc
+++ b/configure/RULES.ioc
@@ -14,7 +14,7 @@ build$(DIVIDER)$(ARCH) build: buildInstall
install$(DIVIDER)$(ARCH) install: buildInstall
$(ARCH): buildInstall
-ifeq ($(filter $(ARCH),$(BUILD_ARCHS)),$(ARCH))
+ifeq ($(filter $(ARCH),$(BUILD_ARCHS)),$(strip $(ARCH)))
buildInstall$(DIVIDER)$(ARCH) buildInstall: $(TARGETS)
clean$(DIVIDER)$(ARCH) clean:
@@ -31,4 +31,3 @@ cdCommands envPaths dllPath.bat relPaths.sh: \
realclean:
$(RM) cdCommands envPaths dllPath.bat relPaths.sh
-
From 3e58c59377566c3a65cd5bc7a609ecf60a68ad19 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 19 Jan 2017 12:33:54 -0600
Subject: [PATCH 67/70] Fix CA server bind issue from Freddie Akeroyd
---
documentation/RELEASE_NOTES.html | 27 +++--
src/cas/io/bsdSocket/casIntfIO.cc | 121 ++++++++++----------
src/libCom/osi/os/Darwin/osdSock.h | 3 +-
src/libCom/osi/os/Linux/osdSock.h | 10 +-
src/libCom/osi/os/RTEMS/osdSock.h | 7 +-
src/libCom/osi/os/WIN32/osdSock.h | 5 +-
src/libCom/osi/os/cygwin32/osdSock.h | 4 +-
src/libCom/osi/os/freebsd/osdSock.h | 6 +-
src/libCom/osi/os/iOS/osdSock.h | 1 +
src/libCom/osi/os/solaris/osdSock.h | 8 +-
src/libCom/osi/os/vxWorks/osdSock.h | 9 +-
src/rsrv/caservertask.c | 161 ++++++++++++++-------------
12 files changed, 188 insertions(+), 174 deletions(-)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 98913581e..859ff7b29 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -13,6 +13,17 @@
+Server bind issue on Windows
+
+When a National Instruments network variables CA server is already running on
+a Windows system and an IOC or PCAS server is started, the IOC's attempt to
+bind a TCP socket to the CA server port number fails, but Windows returns a
+different error status value than the IOC is expecting in that circumstance
+(because the National Instruments code requests exclusive use of that port,
+unlike the EPICS code) so the IOC fails to start properly. The relevent EPICS
+bind() checks have now been updated so the IOC will request that a dynamic port
+number be allocated for this TCP socket instead when this happens.
+
Checking Periodic Scan Rates
Code has been added to the IOC startup to better protect it against bad
@@ -786,7 +797,7 @@ access monitor on the DLYA field; this happens twice during record processing if
the ODLY field is larger than 0.
Timestamps from all seq record monitor events have been wrong since 1995 or
-earlier, the time being provided was from the last time the record processed.
+earlier, the time being provided was from the last time the record processed.
Now the record timestamp will be updated between reading each DOL1..DOLA link
and posting the monitor on the associated DO1..DOA field. The VAL field is
never given a value by the record processing code, but is used for posting
@@ -1018,7 +1029,7 @@ fixed in this release:
717252
local caput causes ioc crash on win32
-750549
+750549
epicsTime has non-portable c++ static initialization
753137
@@ -1372,7 +1383,7 @@ more extensive modifications.
RTEMS 4.10 support
-Added support for the latest release of RTEMS. There is no longer a
+
Added support for the latest release of RTEMS. There is no longer a
distinction between executive and malloc memory pools. The new mount() API
is used.
@@ -1465,7 +1476,7 @@ doing a put
These changes impact the Gateway (Proxy server) and other servers but not
the IOC.
-
Mantis 360 fix - server is unresponsive for one of its clients, when
+
Mantis 360 fix - server is unresponsive for one of its clients, when
async io postponed and in flow control mode
Mantis 358 fix - PCAS service snap-in has no way to determine if its a put,
@@ -1478,7 +1489,7 @@ controling motor through gw.
Mantis 340 fix - leak when performing a read and conversion fails.
-Mantis 348 fix - A call to 'assert (item.pList == this)'
+
Mantis 348 fix - A call to 'assert (item.pList == this)'
failed in ../../../../src/cas/generic/st/ioBlocked.cc line 112
Mantis 345 fix - Compilation warning: complaint about missing
@@ -1494,7 +1505,7 @@ R3.13 client
Mantis 329 fix - GW hang, pthread_mutex_lock failed: error Invalid
argument message
-Mantis 352 fix - gateway hangs temporarily under heavy load on 8-core
+
Mantis 352 fix - gateway hangs temporarily under heavy load on 8-core
64bit RHEL5
@@ -2015,7 +2026,7 @@ tools to allow specifying the CA priority.
GCC_EXEC_PREFIX references removed from configuration files
-Definition of GCC_EXEC_PREFIX removed from CONFIG.CrossCommon and
+
Definition of GCC_EXEC_PREFIX removed from CONFIG.CrossCommon and
unexport of GCC_EXEC_PREFIX removed from vxWorks and RTEMS builds.
RTEMS Release
@@ -3232,7 +3243,7 @@ was returned as -1.17549435E-38. This is now fixed.
in a <name>_DBD macro definition. An include line will be placed in the
<name>Include.dbd for each file specified in the <name>_DBD
definition. If a Makefile contains
-
DBD=xxx.dbd
+ DBD=xxx.dbd
xxx_DBD = f1.dbd f2.dbd f3.dbd
an xxxInclude.dbd file will be created containing the lines
diff --git a/src/cas/io/bsdSocket/casIntfIO.cc b/src/cas/io/bsdSocket/casIntfIO.cc
index 16cd908e3..a284c1800 100644
--- a/src/cas/io/bsdSocket/casIntfIO.cc
+++ b/src/cas/io/bsdSocket/casIntfIO.cc
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
//
@@ -32,7 +32,7 @@ const unsigned caServerConnectPendQueueSize = 5u;
//
// casIntfIO::casIntfIO()
//
-casIntfIO::casIntfIO ( const caNetAddr & addrIn ) :
+casIntfIO::casIntfIO ( const caNetAddr & addrIn ) :
sock ( INVALID_SOCKET ),
addr ( addrIn.getSockIP() )
{
@@ -40,80 +40,79 @@ casIntfIO::casIntfIO ( const caNetAddr & addrIn ) :
osiSocklen_t addrSize;
bool portChange;
- if ( ! osiSockAttach () ) {
- throw S_cas_internal;
- }
+ if ( ! osiSockAttach () ) {
+ throw S_cas_internal;
+ }
- /*
- * Setup the server socket
- */
- this->sock = epicsSocketCreate ( AF_INET, SOCK_STREAM, IPPROTO_TCP );
- if (this->sock==INVALID_SOCKET) {
+ /*
+ * Setup the server socket
+ */
+ this->sock = epicsSocketCreate ( AF_INET, SOCK_STREAM, IPPROTO_TCP );
+ if (this->sock == INVALID_SOCKET) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- printf ( "No socket error was %s\n", sockErrBuf );
- throw S_cas_noFD;
- }
+ printf ( "No socket error was %s\n", sockErrBuf );
+ throw S_cas_noFD;
+ }
epicsSocketEnableAddressReuseDuringTimeWaitState ( this->sock );
- status = bind ( this->sock,
- reinterpret_cast (&this->addr),
- sizeof(this->addr) );
- if (status<0) {
- if (SOCKERRNO == SOCK_EADDRINUSE) {
- //
- // enable assignment of a default port
- // (so the getsockname() call below will
- // work correctly)
- //
- this->addr.sin_port = ntohs (0);
- status = bind(
+ status = bind ( this->sock,
+ reinterpret_cast (&this->addr),
+ sizeof(this->addr) );
+ if (status < 0) {
+ if (SOCKERRNO == SOCK_EADDRINUSE ||
+ SOCKERRNO == SOCK_EACCES) {
+ //
+ // enable assignment of a default port
+ // (so the getsockname() call below will
+ // work correctly)
+ //
+ this->addr.sin_port = ntohs (0);
+ status = bind(
this->sock,
reinterpret_cast (&this->addr),
sizeof(this->addr) );
- }
- if (status<0) {
+ }
+ if (status < 0) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- char buf[64];
- ipAddrToA (&this->addr, buf, sizeof(buf));
- errPrintf ( S_cas_bindFail,
- __FILE__, __LINE__,
- "- bind TCP IP addr=%s failed because %s",
- buf, sockErrBuf );
+ char buf[64];
+ ipAddrToA (&this->addr, buf, sizeof(buf));
+ errlogPrintf ( "CAS: Socket bind TCP to %s failed with %s",
+ buf, sockErrBuf );
epicsSocketDestroy (this->sock);
- throw S_cas_bindFail;
- }
+ throw S_cas_bindFail;
+ }
portChange = true;
- }
+ }
else {
portChange = false;
}
- addrSize = ( osiSocklen_t ) sizeof (this->addr);
- status = getsockname (
- this->sock,
- reinterpret_cast ( &this->addr ),
+ addrSize = ( osiSocklen_t ) sizeof (this->addr);
+ status = getsockname (
+ this->sock,
+ reinterpret_cast ( &this->addr ),
&addrSize );
- if (status) {
+ if (status) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ( "CAS: getsockname() error %s\n",
- sockErrBuf );
+ errlogPrintf ( "CAS: getsockname() error %s\n",
+ sockErrBuf );
epicsSocketDestroy (this->sock);
- throw S_cas_internal;
- }
+ throw S_cas_internal;
+ }
- //
- // be sure of this now so that we can fetch the IP
- // address and port number later
- //
+ //
+ // be sure of this now so that we can fetch the IP
+ // address and port number later
+ //
assert (this->addr.sin_family == AF_INET);
if ( portChange ) {
errlogPrintf ( "cas warning: Configured TCP port was unavailable.\n");
- errlogPrintf ( "cas warning: Using dynamically assigned TCP port %hu,\n",
+ errlogPrintf ( "cas warning: Using dynamically assigned TCP port %hu,\n",
ntohs (this->addr.sin_port) );
errlogPrintf ( "cas warning: but now two or more servers share the same UDP port.\n");
errlogPrintf ( "cas warning: Depending on your IP kernel this server may not be\n" );
@@ -121,12 +120,12 @@ casIntfIO::casIntfIO ( const caNetAddr & addrIn ) :
}
status = listen(this->sock, caServerConnectPendQueueSize);
- if(status < 0) {
+ if (status < 0) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ( "CAS: listen() error %s\n", sockErrBuf );
+ errlogPrintf ( "CAS: listen() error %s\n", sockErrBuf );
epicsSocketDestroy (this->sock);
- throw S_cas_internal;
+ throw S_cas_internal;
}
}
@@ -135,17 +134,17 @@ casIntfIO::casIntfIO ( const caNetAddr & addrIn ) :
//
casIntfIO::~casIntfIO()
{
- if (this->sock != INVALID_SOCKET) {
- epicsSocketDestroy (this->sock);
- }
+ if (this->sock != INVALID_SOCKET) {
+ epicsSocketDestroy (this->sock);
+ }
- osiSockRelease ();
+ osiSockRelease ();
}
//
// newStreamIO::newStreamClient()
//
-casStreamOS *casIntfIO::newStreamClient ( caServerI & cas,
+casStreamOS *casIntfIO::newStreamClient ( caServerI & cas,
clientBufMemoryManager & bufMgr ) const
{
static bool oneMsgFlag = false;
@@ -175,14 +174,14 @@ casStreamOS *casIntfIO::newStreamClient ( caServerI & cas,
args.sock = newSock;
casStreamOS * pOS = new casStreamOS ( cas, bufMgr, args );
if ( ! pOS ) {
- errMessage ( S_cas_noMemory,
+ errMessage ( S_cas_noMemory,
"unable to create data structures for a new client" );
epicsSocketDestroy ( newSock );
}
else {
if ( cas.getDebugLevel() > 0u ) {
char pName[64u];
-
+
pOS->hostName ( pName, sizeof ( pName ) );
errlogPrintf ( "CAS: allocated client object for \"%s\"\n", pName );
}
@@ -197,7 +196,7 @@ void casIntfIO::setNonBlocking()
{
int status;
osiSockIoctl_t yes = true;
-
+
status = socket_ioctl(this->sock, FIONBIO, &yes); // X aCC 392
if ( status < 0 ) {
char sockErrBuf[64];
diff --git a/src/libCom/osi/os/Darwin/osdSock.h b/src/libCom/osi/os/Darwin/osdSock.h
index 961b60663..0700114f0 100644
--- a/src/libCom/osi/os/Darwin/osdSock.h
+++ b/src/libCom/osi/os/Darwin/osdSock.h
@@ -1,7 +1,7 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Saskatchewan
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Eric Norum
@@ -38,6 +38,7 @@ typedef socklen_t osiSocklen_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
diff --git a/src/libCom/osi/os/Linux/osdSock.h b/src/libCom/osi/os/Linux/osdSock.h
index e689526eb..36e84c0b1 100644
--- a/src/libCom/osi/os/Linux/osdSock.h
+++ b/src/libCom/osi/os/Linux/osdSock.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -13,12 +13,12 @@
* Under Linux if we dont define _POSIX_C_SOURCE or _XOPEN_SOURCE
* then none of the POSIX stuff (such as signals) can be used
* with cc -v. However if one of _POSIX_C_SOURCE or _XOPEN_SOURCE
- * are defined then we cant use the socket library. Therefore I
- * have been adding the following in order to use POSIX signals
+ * are defined then we cant use the socket library. Therefore I
+ * have been adding the following in order to use POSIX signals
* and also sockets on Linux with cc -v. What a pain....
*
* #ifdef linux
- * #define __EXTENSIONS__
+ * #define __EXTENSIONS__
* #endif
*/
@@ -53,6 +53,7 @@ typedef socklen_t osiSocklen_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
@@ -82,4 +83,3 @@ typedef socklen_t osiSocklen_t;
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
#endif /*osdSockH*/
-
diff --git a/src/libCom/osi/os/RTEMS/osdSock.h b/src/libCom/osi/os/RTEMS/osdSock.h
index 0f69b2a2c..e60c1bfd2 100644
--- a/src/libCom/osi/os/RTEMS/osdSock.h
+++ b/src/libCom/osi/os/RTEMS/osdSock.h
@@ -1,7 +1,7 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Saskatchewan
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* RTEMS osdSock.h
@@ -35,7 +35,7 @@ int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, str
#ifdef __cplusplus
}
#endif
-
+
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
@@ -49,6 +49,7 @@ typedef socklen_t osiSocklen_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
@@ -74,7 +75,7 @@ typedef socklen_t osiSocklen_t;
#ifndef INADDR_NONE
# define INADDR_NONE (0xffffffff)
-#endif
+#endif
/*
* For shutdown()
diff --git a/src/libCom/osi/os/WIN32/osdSock.h b/src/libCom/osi/os/WIN32/osdSock.h
index e6567e178..17f2afe4a 100644
--- a/src/libCom/osi/os/WIN32/osdSock.h
+++ b/src/libCom/osi/os/WIN32/osdSock.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef osdSockH
@@ -14,7 +14,7 @@
#include
/*
- * winsock2.h changes the structure alignment to 4 if
+ * winsock2.h changes the structure alignment to 4 if
* WIN32 isnt set which can be a source of confusion
*/
#ifndef WIN32
@@ -48,6 +48,7 @@ typedef int osiSocklen_t;
#define SOCK_ENOBUFS WSAENOBUFS
#define SOCK_ECONNRESET WSAECONNRESET
#define SOCK_ETIMEDOUT WSAETIMEDOUT
+#define SOCK_EACCES WSAEACCES
#define SOCK_EADDRINUSE WSAEADDRINUSE
#define SOCK_ECONNREFUSED WSAECONNREFUSED
#define SOCK_ECONNABORTED WSAECONNABORTED
diff --git a/src/libCom/osi/os/cygwin32/osdSock.h b/src/libCom/osi/os/cygwin32/osdSock.h
index 460839a26..34ac5cc70 100644
--- a/src/libCom/osi/os/cygwin32/osdSock.h
+++ b/src/libCom/osi/os/cygwin32/osdSock.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* cygwin32 specific include
@@ -49,6 +49,7 @@ typedef int osiSocklen_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
@@ -66,4 +67,3 @@ typedef int osiSocklen_t;
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
#endif /*osdSockH*/
-
diff --git a/src/libCom/osi/os/freebsd/osdSock.h b/src/libCom/osi/os/freebsd/osdSock.h
index 40df63631..b6858d678 100644
--- a/src/libCom/osi/os/freebsd/osdSock.h
+++ b/src/libCom/osi/os/freebsd/osdSock.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef osdSockH
@@ -29,7 +29,7 @@
#define IPPORT_USERRESERVED 5000
#endif
-
+
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
@@ -43,6 +43,7 @@ typedef socklen_t osiSocklen_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
@@ -76,4 +77,3 @@ typedef socklen_t osiSocklen_t;
#endif
#endif /*osdSockH*/
-
diff --git a/src/libCom/osi/os/iOS/osdSock.h b/src/libCom/osi/os/iOS/osdSock.h
index 136c8f8a9..bebc0ca45 100644
--- a/src/libCom/osi/os/iOS/osdSock.h
+++ b/src/libCom/osi/os/iOS/osdSock.h
@@ -39,6 +39,7 @@ typedef socklen_t osiSocklen_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
diff --git a/src/libCom/osi/os/solaris/osdSock.h b/src/libCom/osi/os/solaris/osdSock.h
index bffcaf367..8b2893626 100644
--- a/src/libCom/osi/os/solaris/osdSock.h
+++ b/src/libCom/osi/os/solaris/osdSock.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -39,7 +39,7 @@ typedef int osiSockIoctl_t;
#if SOLARIS > 6 || defined ( _SOCKLEN_T )
typedef uint32_t osiSocklen_t;
-#else
+#else
typedef int osiSocklen_t;
#endif
@@ -51,6 +51,7 @@ typedef int osiSockIoctl_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
@@ -79,9 +80,8 @@ typedef int osiSockIoctl_t;
#ifndef INADDR_NONE
# define INADDR_NONE (0xffffffff)
-#endif
+#endif
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
#endif /*osdSockH*/
-
diff --git a/src/libCom/osi/os/vxWorks/osdSock.h b/src/libCom/osi/os/vxWorks/osdSock.h
index f220ea8bd..03ecb3153 100644
--- a/src/libCom/osi/os/vxWorks/osdSock.h
+++ b/src/libCom/osi/os/vxWorks/osdSock.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* vxWorks specific socket include
@@ -44,7 +44,7 @@ int sysClkRateGet(void);
#ifdef __cplusplus
}
#endif
-
+
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
@@ -72,6 +72,7 @@ typedef int osiSocklen_t;
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
+#define SOCK_EACCES EACCES
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
@@ -92,7 +93,7 @@ typedef int osiSocklen_t;
#ifndef INADDR_NONE
# define INADDR_NONE (0xffffffff)
-#endif
+#endif
#if defined(_SIZEOF_ADDR_IFREQ)
# define ifreq_size(pifreq) _SIZEOF_ADDR_IFREQ(*pifreq)
@@ -103,5 +104,3 @@ typedef int osiSocklen_t;
#endif
#endif /*osdSockH*/
-
-
diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c
index 51b7e99a8..7867babe6 100644
--- a/src/rsrv/caservertask.c
+++ b/src/rsrv/caservertask.c
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -70,22 +70,22 @@ static void req_server (void *pParm)
epicsSignalInstallSigPipeIgnore ();
taskwdInsert ( epicsThreadGetIdSelf (), NULL, NULL );
-
+
rsrvCurrentClient = epicsThreadPrivateCreate ();
if ( envGetConfigParamPtr ( &EPICS_CAS_SERVER_PORT ) ) {
- ca_server_port = envGetInetPortConfigParam ( &EPICS_CAS_SERVER_PORT,
+ ca_server_port = envGetInetPortConfigParam ( &EPICS_CAS_SERVER_PORT,
(unsigned short) CA_SERVER_PORT );
}
else {
- ca_server_port = envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT,
+ ca_server_port = envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT,
(unsigned short) CA_SERVER_PORT );
}
if (IOC_sock != 0 && IOC_sock != INVALID_SOCKET) {
epicsSocketDestroy ( IOC_sock );
}
-
+
/*
* Open the socket. Use ARPA Internet address format and stream
* sockets. Format described in .
@@ -100,53 +100,54 @@ static void req_server (void *pParm)
/* Zero the sock_addr structure */
memset ( (void *) &serverAddr, 0, sizeof ( serverAddr ) );
serverAddr.sin_family = AF_INET;
- serverAddr.sin_addr.s_addr = htonl (INADDR_ANY);
+ serverAddr.sin_addr.s_addr = htonl (INADDR_ANY);
serverAddr.sin_port = htons ( ca_server_port );
/* get server's Internet address */
status = bind ( IOC_sock, (struct sockaddr *) &serverAddr, sizeof ( serverAddr ) );
- if ( status < 0 ) {
- if ( SOCKERRNO == SOCK_EADDRINUSE ) {
- /*
- * enable assignment of a default port
- * (so the getsockname() call below will
- * work correctly)
- */
- serverAddr.sin_port = ntohs (0);
- status = bind ( IOC_sock,
+ if ( status < 0 ) {
+ if ( SOCKERRNO == SOCK_EADDRINUSE ||
+ SOCKERRNO == SOCK_EACCES ) {
+ /*
+ * enable assignment of a default port
+ * (so the getsockname() call below will
+ * work correctly)
+ */
+ serverAddr.sin_port = ntohs (0);
+ status = bind ( IOC_sock,
(struct sockaddr *) &serverAddr, sizeof ( serverAddr ) );
- }
- if ( status < 0 ) {
+ }
+ if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ( "CAS: Socket bind error was \"%s\"\n",
+ errlogPrintf ( "CAS: Socket bind failed with %s\n",
sockErrBuf );
epicsThreadSuspendSelf ();
- }
+ }
portChange = 1;
- }
+ }
else {
portChange = 0;
}
- addrSize = ( osiSocklen_t ) sizeof ( serverAddr );
- status = getsockname ( IOC_sock,
- (struct sockaddr *)&serverAddr, &addrSize);
- if ( status ) {
+ addrSize = ( osiSocklen_t ) sizeof ( serverAddr );
+ status = getsockname ( IOC_sock,
+ (struct sockaddr *)&serverAddr, &addrSize);
+ if ( status ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ( "CAS: getsockname() error %s\n",
- sockErrBuf );
+ errlogPrintf ( "CAS: getsockname() error %s\n",
+ sockErrBuf );
epicsThreadSuspendSelf ();
- }
+ }
ca_server_port = ntohs (serverAddr.sin_port);
if ( portChange ) {
errlogPrintf ( "cas warning: Configured TCP port was unavailable.\n");
- errlogPrintf ( "cas warning: Using dynamically assigned TCP port %hu,\n",
+ errlogPrintf ( "cas warning: Using dynamically assigned TCP port %hu,\n",
ca_server_port );
errlogPrintf ( "cas warning: but now two or more servers share the same UDP port.\n");
errlogPrintf ( "cas warning: Depending on your IP kernel this server may not be\n" );
@@ -189,13 +190,13 @@ static void req_server (void *pParm)
clientSock = epicsSocketAccept ( IOC_sock, &sockAddr, &addLen );
if ( clientSock == INVALID_SOCKET ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf("CAS: Client accept error was \"%s\"\n",
sockErrBuf );
epicsThreadSleep(15.0);
continue;
- }
+ }
else {
epicsThreadId id;
struct client *pClient;
@@ -279,14 +280,14 @@ int rsrv_init (void)
castcp_ctl = ctlPause;
/*
- * go down two levels so that we are below
+ * go down two levels so that we are below
* the TCP and event threads started on behalf
* of individual clients
*/
- tbs = epicsThreadHighestPriorityLevelBelow (
+ tbs = epicsThreadHighestPriorityLevelBelow (
epicsThreadPriorityCAServerLow, &priorityOfConnectDaemon );
if ( tbs == epicsThreadBooleanStatusSuccess ) {
- tbs = epicsThreadHighestPriorityLevelBelow (
+ tbs = epicsThreadHighestPriorityLevelBelow (
priorityOfConnectDaemon, &priorityOfConnectDaemon );
if ( tbs != epicsThreadBooleanStatusSuccess ) {
priorityOfConnectDaemon = epicsThreadPriorityCAServerLow;
@@ -327,7 +328,7 @@ int rsrv_pause (void)
return RSRV_OK;
}
-static unsigned countChanListBytes (
+static unsigned countChanListBytes (
struct client *client, ELLLIST * pList )
{
struct channel_in_use * pciu;
@@ -346,7 +347,7 @@ static unsigned countChanListBytes (
return bytes_reserved;
}
-static void showChanList (
+static void showChanList (
struct client * client, ELLLIST * pList )
{
unsigned i = 0u;
@@ -354,7 +355,7 @@ static void showChanList (
epicsMutexMustLock ( client->chanListLock );
pciu = (struct channel_in_use *) pList->node.next;
while ( pciu ){
- printf( "\t%s(%d%c%c)",
+ printf( "\t%s(%d%c%c)",
pciu->addr.precord->name,
ellCount ( &pciu->eventq ),
asCheckGet ( pciu->asClientPVT ) ? 'r': '-',
@@ -395,28 +396,28 @@ static void log_one_client (struct client *client, unsigned level)
send_delay = epicsTimeDiffInSeconds(¤t,&client->time_at_last_send);
recv_delay = epicsTimeDiffInSeconds(¤t,&client->time_at_last_recv);
- printf ( "%s %s(%s): User=\"%s\", V%u.%u, %d Channels, Priority=%u\n",
+ printf ( "%s %s(%s): User=\"%s\", V%u.%u, %d Channels, Priority=%u\n",
pproto,
clientHostName,
client->pHostName ? client->pHostName : "",
client->pUserName ? client->pUserName : "",
CA_MAJOR_PROTOCOL_REVISION,
client->minor_version_number,
- ellCount(&client->chanList) +
+ ellCount(&client->chanList) +
ellCount(&client->chanPendingUpdateARList),
client->priority );
if ( level >= 1 ) {
- printf ("\tTask Id=%p, Socket FD=%d\n",
- (void *) client->tid, client->sock);
- printf(
- "\tSecs since last send %6.2f, Secs since last receive %6.2f\n",
+ printf ("\tTask Id=%p, Socket FD=%d\n",
+ (void *) client->tid, client->sock);
+ printf(
+ "\tSecs since last send %6.2f, Secs since last receive %6.2f\n",
send_delay, recv_delay);
- printf(
- "\tUnprocessed request bytes=%u, Undelivered response bytes=%u\n",
+ printf(
+ "\tUnprocessed request bytes=%u, Undelivered response bytes=%u\n",
client->recv.cnt - client->recv.stk,
- client->send.stk );
- printf(
- "\tState=%s%s%s\n",
+ client->send.stk );
+ printf(
+ "\tState=%s%s%s\n",
state[client->disconnect?1:0],
client->send.type == mbtLargeTCP ? " jumbo-send-buf" : "",
client->recv.type == mbtLargeTCP ? " jumbo-recv-buf" : "");
@@ -425,9 +426,9 @@ static void log_one_client (struct client *client, unsigned level)
if ( level >= 2u ) {
unsigned bytes_reserved = 0;
bytes_reserved += sizeof(struct client);
- bytes_reserved += countChanListBytes (
+ bytes_reserved += countChanListBytes (
client, & client->chanList );
- bytes_reserved += countChanListBytes (
+ bytes_reserved += countChanListBytes (
client, & client->chanPendingUpdateARList );
printf( "\t%d bytes allocated\n", bytes_reserved);
showChanList ( client, & client->chanList );
@@ -482,20 +483,20 @@ void epicsShareAPI casr (unsigned level)
printf( "UDP Server:\n" );
log_one_client(prsrv_cast_client, level);
}
-
+
if (level>=2u) {
bytes_reserved = 0u;
- bytes_reserved += sizeof (struct client) *
+ bytes_reserved += sizeof (struct client) *
freeListItemsAvail (rsrvClientFreeList);
bytes_reserved += sizeof (struct channel_in_use) *
freeListItemsAvail (rsrvChanFreeList);
bytes_reserved += sizeof(struct event_ext) *
freeListItemsAvail (rsrvEventFreeList);
- bytes_reserved += MAX_TCP *
+ bytes_reserved += MAX_TCP *
freeListItemsAvail ( rsrvSmallBufFreeListTCP );
- bytes_reserved += rsrvSizeofLargeBufTCP *
+ bytes_reserved += rsrvSizeofLargeBufTCP *
freeListItemsAvail ( rsrvLargeBufFreeListTCP );
- bytes_reserved += rsrvSizeOfPutNotify ( 0 ) *
+ bytes_reserved += rsrvSizeOfPutNotify ( 0 ) *
freeListItemsAvail ( rsrvPutNotifyFreeList );
printf( "There are currently %u bytes on the server's free list\n",
(unsigned int) bytes_reserved);
@@ -522,7 +523,7 @@ void epicsShareAPI casr (unsigned level)
}
}
-/*
+/*
* destroy_client ()
*/
void destroy_client ( struct client *client )
@@ -530,7 +531,7 @@ void destroy_client ( struct client *client )
if ( ! client ) {
return;
}
-
+
if ( client->tid != 0 ) {
taskwdRemove ( client->tid );
}
@@ -600,12 +601,12 @@ void destroy_client ( struct client *client )
if ( client->pHostName ) {
free ( client->pHostName );
- }
+ }
freeListFree ( rsrvClientFreeList, client );
}
-static void destroyAllChannels (
+static void destroyAllChannels (
struct client * client, ELLLIST * pList )
{
if ( !client->chanListLock || !client->eventqLock ) {
@@ -649,7 +650,7 @@ static void destroyAllChannels (
rsrvChannelCount--;
UNLOCK_CLIENTQ;
if ( status != S_bucket_success ) {
- errPrintf ( status, __FILE__, __LINE__,
+ errPrintf ( status, __FILE__, __LINE__,
"Bad id=%d at close", pciu->sid);
}
status = asRemoveClient(&pciu->asClientPVT);
@@ -689,7 +690,7 @@ void destroy_tcp_client ( struct client *client )
if ( client->evuser ) {
db_close_events (client->evuser);
}
-
+
destroy_client ( client );
}
@@ -708,7 +709,7 @@ struct client * create_client ( SOCKET sock, int proto )
spaceAvailOnFreeList = freeListItemsAvail ( rsrvClientFreeList ) > 0
&& freeListItemsAvail ( rsrvSmallBufFreeListTCP ) > 0;
spaceNeeded = sizeof (struct client) + MAX_TCP;
- if ( ! ( osiSufficentSpaceInPool(spaceNeeded) || spaceAvailOnFreeList ) ) {
+ if ( ! ( osiSufficentSpaceInPool(spaceNeeded) || spaceAvailOnFreeList ) ) {
epicsSocketDestroy ( sock );
epicsPrintf ("CAS: no space in pool for a new client (below max block thresh)\n");
return NULL;
@@ -719,7 +720,7 @@ struct client * create_client ( SOCKET sock, int proto )
epicsSocketDestroy ( sock );
epicsPrintf ("CAS: no space in pool for a new client (alloc failed)\n");
return NULL;
- }
+ }
client->sock = sock;
client->proto = proto;
@@ -735,8 +736,8 @@ struct client * create_client ( SOCKET sock, int proto )
return NULL;
}
- client->pUserName = NULL;
- client->pHostName = NULL;
+ client->pUserName = NULL;
+ client->pHostName = NULL;
ellInit ( & client->chanList );
ellInit ( & client->chanPendingUpdateARList );
ellInit ( & client->putNotifyQue );
@@ -774,7 +775,7 @@ struct client * create_client ( SOCKET sock, int proto )
epicsTimeGetCurrent ( &client->time_at_last_recv );
client->minor_version_number = CA_UKN_MINOR_VERSION;
client->recvBytesToDrain = 0u;
-
+
return client;
}
@@ -789,10 +790,10 @@ void casAttachThreadToClient ( struct client *pClient )
void casExpandSendBuffer ( struct client *pClient, ca_uint32_t size )
{
- if ( pClient->send.type == mbtSmallTCP && rsrvSizeofLargeBufTCP > MAX_TCP
+ if ( pClient->send.type == mbtSmallTCP && rsrvSizeofLargeBufTCP > MAX_TCP
&& size <= rsrvSizeofLargeBufTCP ) {
int spaceAvailOnFreeList = freeListItemsAvail ( rsrvLargeBufFreeListTCP ) > 0;
- if ( osiSufficentSpaceInPool(rsrvSizeofLargeBufTCP) || spaceAvailOnFreeList ) {
+ if ( osiSufficentSpaceInPool(rsrvSizeofLargeBufTCP) || spaceAvailOnFreeList ) {
char *pNewBuf = ( char * ) freeListCalloc ( rsrvLargeBufFreeListTCP );
if ( pNewBuf ) {
memcpy ( pNewBuf, pClient->send.buf, pClient->send.stk );
@@ -810,7 +811,7 @@ void casExpandRecvBuffer ( struct client *pClient, ca_uint32_t size )
if ( pClient->recv.type == mbtSmallTCP && rsrvSizeofLargeBufTCP > MAX_TCP
&& size <= rsrvSizeofLargeBufTCP) {
int spaceAvailOnFreeList = freeListItemsAvail ( rsrvLargeBufFreeListTCP ) > 0;
- if ( osiSufficentSpaceInPool(rsrvSizeofLargeBufTCP) || spaceAvailOnFreeList ) {
+ if ( osiSufficentSpaceInPool(rsrvSizeofLargeBufTCP) || spaceAvailOnFreeList ) {
char *pNewBuf = ( char * ) freeListCalloc ( rsrvLargeBufFreeListTCP );
if ( pNewBuf ) {
assert ( pClient->recv.cnt >= pClient->recv.stk );
@@ -847,26 +848,26 @@ struct client *create_tcp_client ( SOCKET sock )
* see TCP(4P) this seems to make unsolicited single events much
* faster. I take care of queue up as load increases.
*/
- status = setsockopt ( sock, IPPROTO_TCP, TCP_NODELAY,
+ status = setsockopt ( sock, IPPROTO_TCP, TCP_NODELAY,
(char *) &intTrue, sizeof (intTrue) );
if (status < 0) {
errlogPrintf ( "CAS: TCP_NODELAY option set failed\n" );
destroy_client ( client );
return NULL;
}
-
- /*
+
+ /*
* turn on KEEPALIVE so if the client crashes
* this task will find out and exit
*/
- status = setsockopt ( sock, SOL_SOCKET, SO_KEEPALIVE,
+ status = setsockopt ( sock, SOL_SOCKET, SO_KEEPALIVE,
(char *) &intTrue, sizeof (intTrue) );
if ( status < 0 ) {
errlogPrintf ( "CAS: SO_KEEPALIVE option set failed\n" );
destroy_client ( client );
return NULL;
}
-
+
/*
* some concern that vxWorks will run out of mBuf's
* if this change is made
@@ -874,8 +875,8 @@ struct client *create_tcp_client ( SOCKET sock )
* joh 11-10-98
*/
#if 0
- /*
- * set TCP buffer sizes to be synergistic
+ /*
+ * set TCP buffer sizes to be synergistic
* with CA internal buffering
*/
i = MAX_MSG_SIZE;
@@ -893,7 +894,7 @@ struct client *create_tcp_client ( SOCKET sock )
return NULL;
}
#endif
-
+
addrSize = sizeof ( client->addr );
status = getpeername ( sock, (struct sockaddr *)&client->addr,
&addrSize );
@@ -926,8 +927,8 @@ struct client *create_tcp_client ( SOCKET sock )
}
}
- status = db_start_events ( client->evuser, "CAS-event",
- NULL, NULL, priorityOfEvents );
+ status = db_start_events ( client->evuser, "CAS-event",
+ NULL, NULL, priorityOfEvents );
if ( status != DB_EVENT_OK ) {
errlogPrintf ( "CAS: unable to start the event facility\n" );
destroy_tcp_client ( client );
From a105c6f538a20a6f134c245e5a23e7cc59b48995 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 24 Jan 2017 11:48:36 -0600
Subject: [PATCH 68/70] Always quote Windows PATH arg's
---
src/tools/convertRelease.pl | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl
index fd6a527c5..c06a8ee68 100644
--- a/src/tools/convertRelease.pl
+++ b/src/tools/convertRelease.pl
@@ -119,15 +119,14 @@ sub dllPath {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
print OUT "\@ECHO OFF\n";
- print OUT "PATH ", join(';', binDirs(), '%PATH%'), "\n";
+ print OUT "PATH \"", join(';', binDirs(), '%PATH%'), "\"\n";
close OUT;
}
sub relPaths {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
- print OUT "export PATH=",
- join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs(), '$PATH'), "\n";
+ print OUT "export PATH=\"", join(':', binDirs(), '$PATH'), "\"\n";
close OUT;
}
From 3a0e52fc3fb7b462550e96a93d5bc84eb9666587 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 24 Jan 2017 14:17:37 -0600
Subject: [PATCH 69/70] Fix Windows dllPath.bat properly
---
src/tools/convertRelease.pl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl
index c06a8ee68..fb2153a34 100644
--- a/src/tools/convertRelease.pl
+++ b/src/tools/convertRelease.pl
@@ -119,7 +119,9 @@ sub dllPath {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
print OUT "\@ECHO OFF\n";
- print OUT "PATH \"", join(';', binDirs(), '%PATH%'), "\"\n";
+ # This SET syntax is essential for supporting embedded spaces and '&'
+ # characters in both the PATH variable and the new directory components
+ print OUT "SET \"PATH=", join(';', binDirs(), '%PATH%'), "\"\n";
close OUT;
}
From faf691a5be53d9bf723504d940887029ace75e16 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 30 Jan 2017 12:11:29 -0600
Subject: [PATCH 70/70] VS2015 starting to dislike '/' for compiler flags
---
configure/os/CONFIG.win32-x86.win32-x86 | 47 ++++++++++-----------
configure/os/CONFIG.windows-x64.windows-x64 | 19 ++++-----
2 files changed, 32 insertions(+), 34 deletions(-)
diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86
index 96cde4cf4..022f80736 100644
--- a/configure/os/CONFIG.win32-x86.win32-x86
+++ b/configure/os/CONFIG.win32-x86.win32-x86
@@ -22,7 +22,7 @@ WINLINK = link
RCCMD = rc -l 0x409 $(INCLUDES) -fo $@ $<
-ARCMD = lib /nologo /verbose /out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS)
+ARCMD = lib -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS)
BAFCMD = bscmake /nologo /o $@
@@ -67,21 +67,21 @@ OBJ_CFLAG = -Fo
# vis c++ compiles the code (and includes
# the header files)
#
-# /MT static multithreaded C RTL
-# /MTd static multithreaded C RTL (debug version)
-# /MD multithreaded C RTL in DLL
-# /MDd multithreaded C RTL in DLL (debug version)
+# -MT static multithreaded C RTL
+# -MTd static multithreaded C RTL (debug version)
+# -MD multithreaded C RTL in DLL
+# -MDd multithreaded C RTL in DLL (debug version)
VISC_DLL_NO = -DEPICS_DLL_NO
VISC_DLL_YES =
VISC_DLL = $(VISC_DLL_$(SHARED_LIBRARIES))
VISC_STATIC_CFLAGS_DEBUG_NO = d
VISC_STATIC_CFLAGS_DEBUG_YES =
VISC_STATIC_CFLAGS_DEBUG = $(VISC_STATIC_CFLAGS_DEBUG_$(HOST_OPT))
-STATIC_CFLAGS_YES= /MT$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
-STATIC_CFLAGS_NO= /MD$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
+STATIC_CFLAGS_YES= -MT$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
+STATIC_CFLAGS_NO= -MD$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
# OS vendor c preprocessor
-CPP = cl /nologo /C /E
+CPP = cl -nologo -C -E
# Configure OS vendor C++ compiler
#
@@ -129,12 +129,12 @@ OBJ_CXXFLAG = -Fo
# vis c++ compiles the code (and includes
# the header files)
#
-# /MT static multithreaded C RTL
-# /MTd static multithreaded C RTL (debug version)
-# /MD multithreaded C RTL in DLL
-# /MDd multithreaded C RTL in DLL (debug version)
-STATIC_CXXFLAGS_YES= /MT$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
-STATIC_CXXFLAGS_NO= /MD$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
+# -MT static multithreaded C RTL
+# -MTd static multithreaded C RTL (debug version)
+# -MD multithreaded C RTL in DLL
+# -MDd multithreaded C RTL in DLL (debug version)
+STATIC_CXXFLAGS_YES= -MT$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
+STATIC_CXXFLAGS_NO= -MD$(VISC_STATIC_CFLAGS_DEBUG) $(VISC_DLL)
STATIC_LDLIBS_YES=ws2_32.lib advapi32.lib user32.lib kernel32.lib winmm.lib
STATIC_LDLIBS_NO=
@@ -173,10 +173,10 @@ BAF=.bsc
BOF=.sbr
# Problem: MS Visual C++ does not recognize *.cc as C++ source,
-# so we do C++ compiles using the global flag -TP
-COMPILER_CXXFLAGS = /TP
+# so we do C++ compiles using the global flag -TP
+COMPILER_CXXFLAGS = -TP
-# Operating system flags
+# Operating system flags
OP_SYS_CFLAGS =
OP_SYS_CXXFLAGS = $(COMPILER_CXXFLAGS)
@@ -192,13 +192,13 @@ OP_SYS_CXXFLAGS = $(COMPILER_CXXFLAGS)
# '-entry:_DllMainCRTStartup$(DLLENTRY)'
DLLENTRY = @12
-WIN32_DLLFLAGS = /subsystem:windows /dll $(OPT_LDFLAGS) \
+WIN32_DLLFLAGS = -subsystem:windows -dll $(OPT_LDFLAGS) \
$(USR_LDFLAGS) $(CMD_LDFLAGS) $(TARGET_LDFLAGS) $(LIB_LDFLAGS)
#
# specify dll .def file only if it exists
#
-DLL_DEF_FLAG = $(addprefix /def:,$(wildcard ../$(addsuffix .def,$*)))
+DLL_DEF_FLAG = $(addprefix -def:,$(wildcard ../$(addsuffix .def,$*)))
#
# A WIN32 dll has three parts:
@@ -206,9 +206,9 @@ DLL_DEF_FLAG = $(addprefix /def:,$(wildcard ../$(addsuffix .def,$*)))
# x.lib: what you link to progs that use the dll (DLL_LINK_LIBNAME)
# x.exp: what you need to build the dll (in no variable)
#
-LINK.shrlib = $(WINLINK) /nologo $(WIN32_DLLFLAGS) /implib:$*.lib /out:$*.dll $(DLL_DEF_FLAG)
+LINK.shrlib = $(WINLINK) -nologo $(WIN32_DLLFLAGS) -implib:$*.lib -out:$*.dll $(DLL_DEF_FLAG)
LINK.shrlib += $(call PATH_FILTER, $(LIBRARY_LD_OBJS) $(LIBRARY_LD_RESS) $(SHRLIB_LDLIBS))
-MUNCH_CMD = $(CCC) /Fo $@ $^
+MUNCH_CMD = $(CCC) -Fo $@ $^
# adjust names of libraries to build
@@ -222,7 +222,7 @@ SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
#
-# When SHARED_LIBRARIES is YES we are building a DLL link library
+# When SHARED_LIBRARIES is YES we are building a DLL link library
# and when SHARED_LIBRARIES is NO we are building an object library
#
DLL_LINK_LIBNAME_YES = $(BUILD_LIBRARY:%=%.lib)
@@ -289,7 +289,7 @@ LINK.cpp = $(WINLINK) -nologo $(STATIC_LDFLAGS) $(LDFLAGS) $(PROD_LDFLAGS) \
#--------------------------------------------------
# UseManifestTool.pl checks MS Visual c++ compiler version number to
# decide whether or not to use the Manifest Tool command to embed the
-# linker created .manifest file into a library or product target.
+# linker created .manifest file into a library or product target.
# useManifestTool.pl returns 0(don't use) or 1(use).
#
MT.exe = mt.exe -nologo -manifest $@.manifest
@@ -299,4 +299,3 @@ MT_EXE_COMMAND_NO = $(MT.exe) "-outputresource:$@;\#1"
MT_EXE_COMMAND1 = $(MT_EXE_COMMAND_$(STATIC_BUILD))
MT_DLL_COMMAND = $(MT_DLL_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl))
MT_EXE_COMMAND = $(MT_EXE_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl))
-
diff --git a/configure/os/CONFIG.windows-x64.windows-x64 b/configure/os/CONFIG.windows-x64.windows-x64
index d820dbacc..86d8bb394 100644
--- a/configure/os/CONFIG.windows-x64.windows-x64
+++ b/configure/os/CONFIG.windows-x64.windows-x64
@@ -9,14 +9,13 @@ include $(CONFIG)/os/CONFIG.win32-x86.win32-x86
-include $(CONFIG)/os/CONFIG_SITE.win32-x86.win32-x86
# Modify CONFIG.win32-x86.win32-x86 settings:
-ARCH_DEP_CPPFLAGS += /favor:blend
-# /favor:blend both AMD64 and INTEL64
-# /favor:AMD64
-# /favor:INTEL64 (new value)
-# /favor:EN64T (old value)
-
-OPT_LDFLAGS += /MACHINE:X64
-# /MACHINE:X64
-# /MACHINE:IA64 (Itanium)
-# /MACHINE:X86
+ARCH_DEP_CPPFLAGS += -favor:blend
+# -favor:blend both AMD64 and INTEL64
+# -favor:AMD64
+# -favor:INTEL64 (new value)
+# -favor:EN64T (old value)
+OPT_LDFLAGS += -MACHINE:X64
+# -MACHINE:X64
+# -MACHINE:IA64 (Itanium)
+# -MACHINE:X86