From e21bf9d9f1233d722a5b9f96a640080cb2b4840d Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 5 Jun 2008 22:06:58 +0000 Subject: [PATCH] Fixed bug in dbPutFieldLink: Couldn't change INP/OUT field of any record type that has no registered device support, whereas we should treat this field just as any other non-device link field. --- src/db/dbAccess.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/db/dbAccess.c b/src/db/dbAccess.c index 1119830a0..635654e15 100644 --- a/src/db/dbAccess.c +++ b/src/db/dbAccess.c @@ -1073,16 +1073,25 @@ static long dbPutFieldLink( if (inpOut) { pdevSup = dbDTYPtoDevSup(precord->rdes, precord->dtyp); - if (pdevSup == NULL || - (new_dset = pdevSup->pdset) == NULL || - (new_dsxt = pdevSup->pdsxt) == NULL || - new_dsxt->add_record == NULL || - (precord->dset && - ((pdevSup = dbDSETtoDevSup(precord->rdes, precord->dset)) == NULL || - pdevSup->pdsxt == NULL || - pdevSup->pdsxt->del_record == NULL))) { - status = S_db_noSupport; - goto unlock; + if (pdevSup == NULL) { + /* This record type has no registered device support, but does have + * an INP or OUT field which we're currently writing to. We handle + * this INP/OUT field just like any other link field. + */ + inpOut = 0; + } else { + new_dset = pdevSup->pdset; + new_dsxt = pdevSup->pdsxt; + if (new_dset == NULL || + new_dsxt == NULL || + new_dsxt->add_record == NULL || + (precord->dset && + ((pdevSup = dbDSETtoDevSup(precord->rdes, precord->dset)) == NULL || + pdevSup->pdsxt == NULL || + pdevSup->pdsxt->del_record == NULL))) { + status = S_db_noSupport; + goto unlock; + } } }