diff --git a/src/ioc/db/dbAccess.c b/src/ioc/db/dbAccess.c index 5303b53b7..b7a650282 100644 --- a/src/ioc/db/dbAccess.c +++ b/src/ioc/db/dbAccess.c @@ -1228,20 +1228,20 @@ long dbPut(DBADDR *paddr, short dbrType, status = dbPutConvertRoutine[dbrType][field_type](paddr, pbuffer, nRequest, no_elements, offset); } - if (status) goto done; /* update array info */ - if (paddr->pfldDes->special == SPC_DBADDR && + if (!status && + paddr->pfldDes->special == SPC_DBADDR && prset && prset->put_array_info) { status = prset->put_array_info(paddr, nRequest); } - if (status) goto done; - /* check if special processing is required */ + /* Always do special processing if needed */ if (special) { - status = dbPutSpecial(paddr,1); - if (status) goto done; + long status2 = dbPutSpecial(paddr, 1); + if (status2) goto done; } + if (status) goto done; /* Propagate monitor events for this field, */ /* unless the field is VAL and PP is true. */ diff --git a/src/ioc/db/dbTest.c b/src/ioc/db/dbTest.c index 334998e3d..d7d778d7f 100644 --- a/src/ioc/db/dbTest.c +++ b/src/ioc/db/dbTest.c @@ -334,7 +334,6 @@ long dbpf(const char *pname,const char *pvalue) { DBADDR addr; long status; - epicsUInt16 value; short dbrType; size_t n = 1; @@ -346,16 +345,7 @@ long dbpf(const char *pname,const char *pvalue) if (nameToAddr(pname, &addr)) return -1; - /* For enumerated types must allow for ENUM rather than string */ - /* If entire field is digits then use DBR_ENUM else DBR_STRING */ - if (addr.dbr_field_type == DBR_ENUM && *pvalue && - strspn(pvalue,"0123456789") == strlen(pvalue)) { - - sscanf(pvalue, "%hu", &value); - pvalue = (char *) &value; - dbrType = DBR_ENUM; - } - else if (addr.no_elements > 1 && + if (addr.no_elements > 1 && (addr.dbr_field_type == DBR_CHAR || addr.dbr_field_type == DBR_UCHAR)) { dbrType = addr.dbr_field_type; n = strlen(pvalue) + 1; diff --git a/src/ioc/dbStatic/dbStaticLib.c b/src/ioc/dbStatic/dbStaticLib.c index 703624950..e6b8d3098 100644 --- a/src/ioc/dbStatic/dbStaticLib.c +++ b/src/ioc/dbStatic/dbStaticLib.c @@ -1226,14 +1226,19 @@ long dbGetAttributePart(DBENTRY *pdbentry, const char **ppname) const char *pname = *ppname; dbRecordAttribute *pattribute; - if (!precordType) return S_dbLib_recordTypeNotFound; + if (!precordType) + return S_dbLib_recordTypeNotFound; + pattribute = (dbRecordAttribute *)ellFirst(&precordType->attributeList); while (pattribute) { size_t nameLen = strlen(pattribute->name); int compare = strncmp(pattribute->name, pname, nameLen); - int ch = pname[nameLen]; + if (compare == 0) { - if (!(ch == '_' || isalnum(ch))) { + int ch = pname[nameLen]; + + if (ch != '_' && !isalnum(ch)) { + /* Any other character can't be in the attribute name */ pdbentry->pflddes = pattribute->pdbFldDes; pdbentry->pfield = pattribute->value; *ppname = &pname[nameLen]; diff --git a/src/libCom/osi/os/WIN32/osdTime.h b/src/libCom/osi/os/WIN32/osdTime.h index 899eeb46a..5875c0e7e 100644 --- a/src/libCom/osi/os/WIN32/osdTime.h +++ b/src/libCom/osi/os/WIN32/osdTime.h @@ -3,9 +3,8 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* @@ -14,15 +13,22 @@ * Author: Jeff Hill */ -#ifndef osdTimeh -#define osdTimeh +#ifndef INC_osdTime_H +#define INC_osdTime_H #if ! defined(_MINGW) || ! defined(_TIMESPEC_DEFINED) +# if _MSC_VER >= 1900 +# include +# else + +#define _TIMESPEC_DEFINED 1 struct timespec { - time_t tv_sec; /* seconds since some epoch */ - long tv_nsec; /* nanoseconds within the second */ + time_t tv_sec; /* seconds since some epoch */ + long tv_nsec; /* nanoseconds within the second */ }; + +# endif /* _MSC_VER */ #endif /* ! defined(_MINGW) || ! defined(_TIMESPEC_DEFINED) */ -#endif /* ifndef osdTimeh */ +#endif /* ifndef INC_osdTime_H */