diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index ea84db8be..3d26a502d 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -170,8 +170,9 @@ ifdef RES @$(RM) *$(RES) endif -$(DIRECTORY_TARGETS) : - $(MKDIR) $@ +# Sort mkdir targets to remove duplicates & make parents first +$(DIRECTORY_TARGETS): + $(MKDIR) $(sort $@) # Install LIB_INSTALLS libraries before linking executables $(TESTPRODNAME) $(PRODNAME): | $(INSTALL_LIB_INSTALLS) diff --git a/src/ca/client/oldChannelNotify.cpp b/src/ca/client/oldChannelNotify.cpp index 5775bcc6b..701f51fc1 100644 --- a/src/ca/client/oldChannelNotify.cpp +++ b/src/ca/client/oldChannelNotify.cpp @@ -390,7 +390,7 @@ int epicsShareAPI ca_array_get_callback ( chtype type, { caStatus = ECA_ALLOCMEM; } - catch ( cacChannel::msgBodyCacheTooSmall ) { + catch ( cacChannel::msgBodyCacheTooSmall & ) { caStatus = ECA_TOLARGE; } catch ( ... ) diff --git a/src/ca/client/tools/caput.c b/src/ca/client/tools/caput.c index 9c50cd9df..5e4d10e23 100644 --- a/src/ca/client/tools/caput.c +++ b/src/ca/client/tools/caput.c @@ -8,7 +8,7 @@ * Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer * Synchrotronstrahlung. * 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. \*************************************************************************/ /* @@ -419,7 +419,7 @@ int main (int argc, char *argv[]) if (argc > optind+1) { for (i = optind + 1; i < argc; i++) { strcat(cbuf, " "); - strcat(cbuf, argv[i]); + strcat(cbuf, argv[i]); } } @@ -530,6 +530,11 @@ int main (int argc, char *argv[]) /* Use standard put with defined timeout */ result = ca_array_put (dbrType, count, pvs[0].chid, pbuf); } + if (result != ECA_NORMAL) { + fprintf(stderr, "Error from put operation: %s\n", ca_message(result)); + return 1; + } + result = ca_pend_io(caTimeout); if (result == ECA_TIMEOUT) { fprintf(stderr, "Write operation timed out: Data was not written.\n"); @@ -545,7 +550,7 @@ int main (int argc, char *argv[]) } if (result != ECA_NORMAL) { - fprintf(stderr, "Error occured writing data.\n"); + fprintf(stderr, "Error occured writing data: %s\n", ca_message(result)); return 1; } diff --git a/src/std/rec/stringinRecord.c b/src/std/rec/stringinRecord.c index 163b23a49..6cc6b3bbf 100644 --- a/src/std/rec/stringinRecord.c +++ b/src/std/rec/stringinRecord.c @@ -94,6 +94,7 @@ static long init_record(struct dbCommon *pcommon, int pass) { struct stringinRecord *prec = (struct stringinRecord *)pcommon; STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val)); + STATIC_ASSERT(sizeof(prec->sval)==sizeof(prec->val)); struct stringindset *pdset = (struct stringindset *) prec->dset; if (pass==0) @@ -119,7 +120,8 @@ static long init_record(struct dbCommon *pcommon, int pass) if (status) return status; } - strcpy(prec->oval, prec->val); + + strncpy(prec->oval, prec->val, sizeof(prec->val)); return 0; } @@ -194,7 +196,7 @@ static long readValue(stringinRecord *prec) status=dbGetLink(&(prec->siol),DBR_STRING, prec->sval,0,0); if (status==0) { - strcpy(prec->val,prec->sval); + strncpy(prec->val, prec->sval, sizeof(prec->val)); prec->udf=FALSE; } } else { diff --git a/src/std/rec/stringoutRecord.c b/src/std/rec/stringoutRecord.c index 416a6db5e..b865e5106 100644 --- a/src/std/rec/stringoutRecord.c +++ b/src/std/rec/stringoutRecord.c @@ -96,6 +96,7 @@ static long init_record(struct dbCommon *pcommon, int pass) { struct stringoutRecord *prec = (struct stringoutRecord *)pcommon; STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val)); + STATIC_ASSERT(sizeof(prec->ivov)==sizeof(prec->val)); struct stringoutdset *pdset = (struct stringoutdset *) prec->dset; if (pass==0) @@ -125,7 +126,7 @@ static long init_record(struct dbCommon *pcommon, int pass) return status; } - strcpy(prec->oval, prec->val); + strncpy(prec->oval, prec->val, sizeof(prec->val)); return 0; } @@ -164,7 +165,7 @@ static long process(struct dbCommon *pcommon) break; case (menuIvoaSet_output_to_IVOV) : if(prec->pact == FALSE){ - strcpy(prec->val,prec->ivov); + strncpy(prec->val, prec->ivov, sizeof(prec->val)); } status=writeValue(prec); /* write the new value */ break;